diff options
author | Martin Erik Werner <martinerikwerner@gmail.com> | 2014-02-04 15:25:17 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-02-04 11:25:33 -0800 |
commit | e5aa1fc472696bfc337b3f128d45c1ef2aba394d (patch) | |
tree | ac7041726784f60ec793d947c71f38946878e0fc /t/t0060-path-utils.sh | |
parent | 74af95d6aac03e1a1227c78d0d0ea8bbc2fa2b4d (diff) | |
download | git-e5aa1fc472696bfc337b3f128d45c1ef2aba394d.tar.gz git-e5aa1fc472696bfc337b3f128d45c1ef2aba394d.tar.xz |
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 <martinerikwerner@gmail.com>
Reviewed-by: Duy Nguyen <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t0060-path-utils.sh')
-rwxr-xr-x | t/t0060-path-utils.sh | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/t/t0060-path-utils.sh b/t/t0060-path-utils.sh index 0bba9887e..b8e92e1a2 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 |