From 658219f1c75e25adbe530a3b681ba3d2332caca6 Mon Sep 17 00:00:00 2001 From: Ross Lagerwall Date: Mon, 9 Apr 2012 15:27:56 +0200 Subject: rev-parse --show-prefix: add in trailing newline Print out a trailing newline when --show-prefix is run with cwd at the top level of the tree which results in an empty prefix. Behavior is now like --show-cdup. Fixes an expected failure in t1501. Signed-off-by: Ross Lagerwall Signed-off-by: Junio C Hamano --- builtin/rev-parse.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'builtin/rev-parse.c') 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")) { -- cgit v1.2.3