Imported Upstream version 2.16.0
[platform/upstream/git.git] / t / t3004-ls-files-basic.sh
index 8d9bc3c..9c7adbd 100755 (executable)
@@ -36,4 +36,21 @@ test_expect_success 'ls-files -h in corrupt repository' '
        test_i18ngrep "[Uu]sage: git ls-files " broken/usage
 '
 
+test_expect_success SYMLINKS 'ls-files with absolute paths to symlinks' '
+       mkdir subs &&
+       ln -s nosuch link &&
+       ln -s ../nosuch subs/link &&
+       git add link subs/link &&
+       git ls-files -s link subs/link >expect &&
+       git ls-files -s "$(pwd)/link" "$(pwd)/subs/link" >actual &&
+       test_cmp expect actual &&
+
+       (
+               cd subs &&
+               git ls-files -s link >../expect &&
+               git ls-files -s "$(pwd)/link" >../actual
+       ) &&
+       test_cmp expect actual
+'
+
 test_done