fsck: warn about ".git" in trees
[git/git.git] / t / t1450-fsck.sh
index 0b5c30b..d730734 100755 (executable)
@@ -253,4 +253,19 @@ test_expect_success 'fsck notices "." and ".." in trees' '
        )
 '
 
+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