diff options
author | Brandon Williams <bmwill@google.com> | 2017-06-22 11:43:36 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-06-23 18:24:34 -0700 |
commit | 7aee36013af88c5b61c5b07196555249a11993d2 (patch) | |
tree | d74cd5b18c23b69b19d098d8b37d8ebb4aeef5ac | |
parent | path: create path.h (diff) | |
download | tgif-7aee36013af88c5b61c5b07196555249a11993d2.tar.xz |
path: always pass in commondir to update_common_dir
Instead of passing in 'NULL' and having 'update_common_dir()' query for
the commondir, have the callers of 'update_common_dir()' be responsible
for providing the commondir.
Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | path.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -345,8 +345,6 @@ static void update_common_dir(struct strbuf *buf, int git_dir_len, { char *base = buf->buf + git_dir_len; init_common_trie(); - if (!common_dir) - common_dir = get_git_common_dir(); if (trie_find(&common_trie, base, check_common, NULL) > 0) replace_dir(buf, git_dir_len, common_dir); } @@ -387,7 +385,7 @@ static void adjust_git_path(struct strbuf *buf, int git_dir_len) else if (git_hooks_path && dir_prefix(base, "hooks")) replace_dir(buf, git_dir_len + 5, git_hooks_path); else if (the_repository->different_commondir) - update_common_dir(buf, git_dir_len, NULL); + update_common_dir(buf, git_dir_len, get_git_common_dir()); } static void do_git_path(const struct worktree *wt, struct strbuf *buf, |