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>
Brandon Williams committed
Jun 22, 2017 at 11:43 UTC
7aee36013af88c5b61c5b07196555249a11993d2
1 file changed
+1
-3
path.c
+1
-3
@@ -345,8 +345,6 @@ static void update_common_dir(struct strbuf *buf, int git_dir_len,
345
{
346
char *base = buf->buf + git_dir_len;
347
init_common_trie();
348
- if (!common_dir)
349
- common_dir = get_git_common_dir();
348
if (trie_find(&common_trie, base, check_common, NULL) > 0)
349
replace_dir(buf, git_dir_len, common_dir);
350
}
@@ -387,7 +385,7 @@ static void adjust_git_path(struct strbuf *buf, int git_dir_len)
385
else if (git_hooks_path && dir_prefix(base, "hooks"))
386
replace_dir(buf, git_dir_len + 5, git_hooks_path);
387
else if (the_repository->different_commondir)
390
- update_common_dir(buf, git_dir_len, NULL);
388
+ update_common_dir(buf, git_dir_len, get_git_common_dir());
389
}
390
391
static void do_git_path(const struct worktree *wt, struct strbuf *buf,