summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-08-19 21:48:56 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-08-19 21:48:56 (GMT)
commit8c9155e031869293b99531a25b585e49f74beaba (patch)
tree4ed3a2872b4011806c28a0c38cf977a4de68a51e /dir.c
parent51a22ce1477b991793c20d3143d72f0ae6e38c76 (diff)
parentf932729cc7707390f4d6739be1573e93ceb9df22 (diff)
downloadgit-8c9155e031869293b99531a25b585e49f74beaba.zip
git-8c9155e031869293b99531a25b585e49f74beaba.tar.gz
git-8c9155e031869293b99531a25b585e49f74beaba.tar.bz2
Merge branch 'jk/git-path'
git_path() and mkpath() are handy helper functions but it is easy to misuse, as the callers need to be careful to keep the number of active results below 4. Their uses have been reduced. * jk/git-path: memoize common git-path "constant" files get_repo_path: refactor path-allocation find_hook: keep our own static buffer refs.c: remove_empty_directories can take a strbuf refs.c: avoid git_path assignment in lock_ref_sha1_basic refs.c: avoid repeated git_path calls in rename_tmp_log refs.c: simplify strbufs in reflog setup and writing path.c: drop git_path_submodule refs.c: remove extra git_path calls from read_loose_refs remote.c: drop extraneous local variable from migrate_file prefer mkpathdup to mkpath in assignments prefer git_pathdup to git_path in some possibly-dangerous cases add_to_alternates_file: don't add duplicate entries t5700: modernize style cache.h: complete set of git_path_submodule helpers cache.h: clarify documentation for git_path, et al
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/dir.c b/dir.c
index 3881f55..c00c7e2 100644
--- a/dir.c
+++ b/dir.c
@@ -2174,6 +2174,8 @@ int remove_dir_recursively(struct strbuf *path, int flag)
return remove_dir_recurse(path, flag, NULL);
}
+static GIT_PATH_FUNC(git_path_info_exclude, "info/exclude")
+
void setup_standard_excludes(struct dir_struct *dir)
{
const char *path;
@@ -2188,7 +2190,7 @@ void setup_standard_excludes(struct dir_struct *dir)
dir->untracked ? &dir->ss_excludes_file : NULL);
/* per repository user preference */
- path = git_path("info/exclude");
+ path = git_path_info_exclude();
if (!access_or_warn(path, R_OK, 0))
add_excludes_from_file_1(dir, path,
dir->untracked ? &dir->ss_info_exclude : NULL);