]> git.ipfire.org Git - thirdparty/git.git/commit - path.c
path: implement common_dir handling in git_pathdup_submodule()
authorMax Kirillov <max@max630.net>
Sun, 13 Sep 2015 22:17:42 +0000 (01:17 +0300)
committerJunio C Hamano <gitster@pobox.com>
Mon, 14 Sep 2015 18:03:46 +0000 (11:03 -0700)
commit11f9dd719104a960d3e2b478477d9055141d1dbc
treea8a9549888fdfe7acda74ad4a0fed457c2f8c55e
parent35fb4d2e3d4a3cd008ec0baa077939f60a64f244
path: implement common_dir handling in git_pathdup_submodule()

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>
cache.h
path.c
setup.c
t/t7410-submodule-checkout-to.sh