summaryrefslogtreecommitdiff
path: root/setup.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-10-10 15:56:16 -0700
committerJunio C Hamano <gitster@pobox.com>2011-10-10 15:56:17 -0700
commitefc5fb6a77780c53c6636326ca82ff87b17e4c5f (patch)
treedf55c7da6100b8b102b183dee72c9137b0d68075 /setup.c
parent27c0f768843b6d844674f1fb8dc2676d830b56e3 (diff)
parent501770e1bb5d132ae4f79aa96715f07f6b84e1f6 (diff)
downloadgit-efc5fb6a77780c53c6636326ca82ff87b17e4c5f.tar.gz
Merge branch 'fg/submodule-git-file-git-dir'
* fg/submodule-git-file-git-dir: Move git-dir for submodules rev-parse: add option --resolve-git-dir <path> Conflicts: cache.h git-submodule.sh
Diffstat (limited to 'setup.c')
-rw-r--r--setup.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/setup.c b/setup.c
index 27c1d4787a..b2b4872b70 100644
--- a/setup.c
+++ b/setup.c
@@ -812,3 +812,10 @@ const char *setup_git_directory(void)
{
return setup_git_directory_gently(NULL);
}
+
+const char *resolve_gitdir(const char *suspect)
+{
+ if (is_git_directory(suspect))
+ return suspect;
+ return read_gitfile(suspect);
+}