Commits

Anonymous committed 0582afb Merge

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

Comments (0)

Files changed (2)

builtin/rev-parse.c

 			if (!strcmp(arg, "--show-prefix")) {
 				if (prefix)
 					puts(prefix);
+				else
+					putchar('\n');
 				continue;
 			}
 			if (!strcmp(arg, "--show-cdup")) {

t/t1501-worktree.sh

 	)
 '
 
-test_expect_failure 'empty prefix is actually written out' '
+test_expect_success 'empty prefix is actually written out' '
 	echo >expected &&
 	(
 		cd work &&