summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2012-04-23 12:40:08 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2012-04-23 12:40:08 -0700
commitbca57eeac17204338aa142c16843522308b2d321 (patch)
tree73652cee64e974ec9627ccd9468c1024dbf74893 /builtin
parentMerge branch 'pw/git-p4' (diff)
parentrev-parse --show-prefix: add in trailing newline (diff)
downloadtgif-bca57eeac17204338aa142c16843522308b2d321.tar.xz
Merge branch 'rl/show-empty-prefix'
"git rev-parse --show-prefix" emitted nothing when run at the top-level of the working tree, while "git rev-parse --show-cdup" gave an empty line. Make them consistent. By Ross Lagerwall * rl/show-empty-prefix: rev-parse --show-prefix: add in trailing newline
Diffstat (limited to 'builtin')
-rw-r--r--builtin/rev-parse.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c
index 98d1cbecca..733f626f6c 100644
--- a/builtin/rev-parse.c
+++ b/builtin/rev-parse.c
@@ -634,6 +634,8 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
if (!strcmp(arg, "--show-prefix")) {
if (prefix)
puts(prefix);
+ else
+ putchar('\n');
continue;
}
if (!strcmp(arg, "--show-cdup")) {