Skip to content

Commit

Permalink
Merge branch 'rl/show-empty-prefix' into maint
Browse files Browse the repository at this point in the history
Unlike "git rev-parse --show-cdup", "--show-prefix" did not give an
empty line when run at the top of the working tree.

By Ross Lagerwall
* rl/show-empty-prefix:
  rev-parse --show-prefix: add in trailing newline
  • Loading branch information
Junio C Hamano committed May 11, 2012
2 parents e6a1c43 + 658219f commit 0582afb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions builtin/rev-parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -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")) {
Expand Down
2 changes: 1 addition & 1 deletion t/t1501-worktree.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down

0 comments on commit 0582afb

Please sign in to comment.