diff options
-rw-r--r-- | builtin/rev-parse.c | 2 | ||||
-rwxr-xr-x | t/t1501-worktree.sh | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c index 98d1cbecc..733f626f6 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")) { diff --git a/t/t1501-worktree.sh b/t/t1501-worktree.sh index e661147c5..8f36aa9fc 100755 --- a/t/t1501-worktree.sh +++ b/t/t1501-worktree.sh @@ -68,7 +68,7 @@ test_expect_success 'inside work tree' ' ) ' -test_expect_failure 'empty prefix is actually written out' ' +test_expect_success 'empty prefix is actually written out' ' echo >expected && ( cd work && |