summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorMax Kirillov <max@max630.net>2015-09-14 01:17:42 +0300
committerJunio C Hamano <gitster@pobox.com>2015-09-14 11:03:46 -0700
commit11f9dd719104a960d3e2b478477d9055141d1dbc (patch)
treea8a9549888fdfe7acda74ad4a0fed457c2f8c55e /cache.h
parent35fb4d2e3d4a3cd008ec0baa077939f60a64f244 (diff)
downloadgit-11f9dd719104a960d3e2b478477d9055141d1dbc.tar.gz
path: implement common_dir handling in git_pathdup_submodule()mk/submodule-gitdir-path
When submodule is a linked worktree, "git diff --submodule" and other calls which directly access the submodule's object database do not correctly calculate its path. Fix it by changing the git_pathdup_submodule() behavior, to use either common or per-worktree directory. Do it similarly as for parent repository, but ignore the GIT_COMMON_DIR environment variable, because it would mean common directory for the parent repository and does not make sense for submodule. Also add test for functionality which uses this call. Signed-off-by: Max Kirillov <max@max630.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index 79066e57dc..5eb36b413c 100644
--- a/cache.h
+++ b/cache.h
@@ -443,6 +443,7 @@ extern char *get_object_directory(void);
extern char *get_index_file(void);
extern char *get_graft_file(void);
extern int set_git_dir(const char *path);
+extern int get_common_dir_noenv(struct strbuf *sb, const char *gitdir);
extern int get_common_dir(struct strbuf *sb, const char *gitdir);
extern const char *get_git_namespace(void);
extern const char *strip_namespace(const char *namespaced_ref);