summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2011-10-10 15:56:16 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2011-10-10 15:56:17 -0700
commitefc5fb6a77780c53c6636326ca82ff87b17e4c5f (patch)
treedf55c7da6100b8b102b183dee72c9137b0d68075 /builtin
parentFix some "variable might be used uninitialized" warnings (diff)
parentMove git-dir for submodules (diff)
downloadtgif-efc5fb6a77780c53c6636326ca82ff87b17e4c5f.tar.xz
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 'builtin')
-rw-r--r--builtin/rev-parse.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c
index 4c19f844a9..98d1cbecca 100644
--- a/builtin/rev-parse.c
+++ b/builtin/rev-parse.c
@@ -468,6 +468,14 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
return 0;
}
+ if (argc > 2 && !strcmp(argv[1], "--resolve-git-dir")) {
+ const char *gitdir = resolve_gitdir(argv[2]);
+ if (!gitdir)
+ die("not a gitdir '%s'", argv[2]);
+ puts(gitdir);
+ return 0;
+ }
+
if (argc > 1 && !strcmp("-h", argv[1]))
usage(builtin_rev_parse_usage);