1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-10-30 13:57:54 +01:00

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
This commit is contained in:
Junio C Hamano 2012-04-23 12:40:08 -07:00
commit bca57eeac1
2 changed files with 3 additions and 1 deletions

View file

@ -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")) {

View file

@ -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 &&