Merge branch 'nd/pathspec-wildcard'
[gitweb.git] / t / t1450-fsck.sh
index bf7a2cd6fb649e3b210b537d4d25312ba2921f16..d730734fde8e4de69fdf2662915bc67342198fc8 100755 (executable)
@@ -177,9 +177,7 @@ test_expect_success 'tag pointing to something else than its type' '
        test_when_finished "remove_object $tag" &&
        echo $tag >.git/refs/tags/wrong &&
        test_when_finished "git update-ref -d refs/tags/wrong" &&
-       test_must_fail git fsck --tags 2>out &&
-       cat out &&
-       grep "error in tag.*broken links" out
+       test_must_fail git fsck --tags
 '
 
 test_expect_success 'cleaned up' '
@@ -239,4 +237,35 @@ test_expect_success 'fsck notices submodule entry pointing to null sha1' '
        )
 '
 
+test_expect_success 'fsck notices "." and ".." in trees' '
+       (
+               git init dots &&
+               cd dots &&
+               blob=$(echo foo | git hash-object -w --stdin) &&
+               tab=$(printf "\\t") &&
+               git mktree <<-EOF &&
+               100644 blob $blob$tab.
+               100644 blob $blob$tab..
+               EOF
+               git fsck 2>out &&
+               cat out &&
+               grep "warning.*\\." out
+       )
+'
+
+test_expect_success 'fsck notices ".git" in trees' '
+       (
+               git init dotgit &&
+               cd dotgit &&
+               blob=$(echo foo | git hash-object -w --stdin) &&
+               tab=$(printf "\\t") &&
+               git mktree <<-EOF &&
+               100644 blob $blob$tab.git
+               EOF
+               git fsck 2>out &&
+               cat out &&
+               grep "warning.*\\.git" out
+       )
+'
+
 test_done