зеркало из https://github.com/microsoft/git.git
Merge branch 'rl/show-empty-prefix' into maint
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
This commit is contained in:
Коммит
0582afbcb3
|
@ -634,6 +634,8 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
|
||||||
if (!strcmp(arg, "--show-prefix")) {
|
if (!strcmp(arg, "--show-prefix")) {
|
||||||
if (prefix)
|
if (prefix)
|
||||||
puts(prefix);
|
puts(prefix);
|
||||||
|
else
|
||||||
|
putchar('\n');
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!strcmp(arg, "--show-cdup")) {
|
if (!strcmp(arg, "--show-cdup")) {
|
||||||
|
|
|
@ -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 &&
|
echo >expected &&
|
||||||
(
|
(
|
||||||
cd work &&
|
cd work &&
|
||||||
|
|
Загрузка…
Ссылка в новой задаче