Skip to content

Commit

Permalink
t0060: add test for prefix_path when path == work tree
Browse files Browse the repository at this point in the history
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 <martinerikwerner@gmail.com>
Reviewed-by: Duy Nguyen <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Martin Erik Werner authored and Junio C Hamano committed Feb 4, 2014
1 parent 74af95d commit e5aa1fc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions t/t0060-path-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,12 @@ test_expect_failure SYMLINKS 'prefix_path works with absolute paths to work tree
test "$(test-path-utils prefix_path prefix "$(pwd)/symlink")" = "symlink"
'

test_expect_success 'prefix_path works with only absolute path to work tree' '
echo "" >expected &&
test-path-utils prefix_path prefix "$(pwd)" >actual &&
test_cmp expected actual
'

relative_path /foo/a/b/c/ /foo/a/b/ c/
relative_path /foo/a/b/c/ /foo/a/b c/
relative_path /foo/a//b//c/ ///foo/a/b// c/ POSIX
Expand Down

0 comments on commit e5aa1fc

Please sign in to comment.