[PATCH v4 2/4] t0060: Add test for prefix_path when path == work tree
- From
Martin Erik Werner <martinerikwerner@gmail.com>
- Date
- Feb 2, 2014, 01:59 UTC
- Message-ID
- <1391306351-13237-3-git-send-email-martinerikwerner@gmail.com>
- In-Reply-To
- <1391306351-13237-1-git-send-email-martinerikwerner@gmail.com>
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> --- t/t0060-path-utils.sh | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/t/t0060-path-utils.sh b/t/t0060-path-utils.sh index 0bba988..b8e92e1 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
-- 1.8.5.2