From: Martin Erik Werner Date: Tue, 4 Feb 2014 14:25:17 +0000 (+0100) Subject: t0060: add test for prefix_path when path == work tree X-Git-Tag: v2.0.0-rc0~155^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e5aa1fc472696bfc337b3f128d45c1ef2aba394d;p=thirdparty%2Fgit.git 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 Reviewed-by: Duy Nguyen Signed-off-by: Junio C Hamano --- diff --git a/t/t0060-path-utils.sh b/t/t0060-path-utils.sh index 0bba9887e9..b8e92e1a2a 100755 --- a/t/t0060-path-utils.sh +++ b/t/t0060-path-utils.sh @@ -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