summaryrefslogtreecommitdiff
path: root/builtin-rev-parse.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2010-01-20 14:38:30 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2010-01-20 14:38:30 -0800
commitc757c52f63cfaa9446f9ae93e44acc6ca610650f (patch)
tree6728e74757e2b992802be7a987c1adf4894e4c81 /builtin-rev-parse.c
parentMerge branch 'jc/symbol-static' (diff)
parentUse $(git rev-parse --show-toplevel) in cd_to_toplevel(). (diff)
downloadtgif-c757c52f63cfaa9446f9ae93e44acc6ca610650f.tar.xz
Merge branch 'sd/cd-p-show-toplevel'
* sd/cd-p-show-toplevel: Use $(git rev-parse --show-toplevel) in cd_to_toplevel(). Add 'git rev-parse --show-toplevel' option.
Diffstat (limited to 'builtin-rev-parse.c')
-rw-r--r--builtin-rev-parse.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/builtin-rev-parse.c b/builtin-rev-parse.c
index 37d0233521..cbe5b428ad 100644
--- a/builtin-rev-parse.c
+++ b/builtin-rev-parse.c
@@ -581,6 +581,12 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
for_each_remote_ref(show_reference, NULL);
continue;
}
+ if (!strcmp(arg, "--show-toplevel")) {
+ const char *work_tree = get_git_work_tree();
+ if (work_tree)
+ puts(work_tree);
+ continue;
+ }
if (!strcmp(arg, "--show-prefix")) {
if (prefix)
puts(prefix);