fsck: warn about '.' and '..' in trees
[gitweb.git] / t / t1450-fsck.sh
index 08aa24ca15a377826b9e1cdad73fb232853aea7f..0b5c30b4d95cf2f94f706188fb1841ad8c8e3459 100755 (executable)
@@ -237,4 +237,20 @@ 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_done