t0060: add test for prefix_path on symlinks via absolute paths
[gitweb.git] / t / t0060-path-utils.sh
index 07c10c8dca80b9d289431a72d5bf120ca442113d..0bba9887e9cc5dcdd9eb62a56bcd74c5c9acd644 100755 (executable)
@@ -190,6 +190,11 @@ test_expect_success SYMLINKS 'real path works on symlinks' '
        test "$sym" = "$(test-path-utils real_path "$dir2/syml")"
 '
 
+test_expect_failure SYMLINKS 'prefix_path works with absolute paths to work tree symlinks' '
+       ln -s target symlink &&
+       test "$(test-path-utils prefix_path prefix "$(pwd)/symlink")" = "symlink"
+'
+
 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