Skip to content

Commit e5aa1fc

Browse files
ienorandgitster
authored andcommitted
t0060: add test for prefix_path when path == work tree
The current behaviour of prefix_path is to return an empty string if prefixing and absolute path that only contains exactly the work tree. This behaviour is a potential regression point. Signed-off-by: Martin Erik Werner <[email protected]> Reviewed-by: Duy Nguyen <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 74af95d commit e5aa1fc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

t/t0060-path-utils.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,12 @@ test_expect_failure SYMLINKS 'prefix_path works with absolute paths to work tree
195195
test "$(test-path-utils prefix_path prefix "$(pwd)/symlink")" = "symlink"
196196
'
197197

198+
test_expect_success 'prefix_path works with only absolute path to work tree' '
199+
echo "" >expected &&
200+
test-path-utils prefix_path prefix "$(pwd)" >actual &&
201+
test_cmp expected actual
202+
'
203+
198204
relative_path /foo/a/b/c/ /foo/a/b/ c/
199205
relative_path /foo/a/b/c/ /foo/a/b c/
200206
relative_path /foo/a//b//c/ ///foo/a/b// c/ POSIX

0 commit comments

Comments
 (0)