X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=t%2Ft1450-fsck.sh;h=8c739c96135fe942d7e76236eb34429be93937a8;hb=98e3d8faf9eebd382f62a75c886b7e1c6a20279b;hp=08aa24ca15a377826b9e1cdad73fb232853aea7f;hpb=264628a2b3a5cb6c7671ea87ceecab941ec290e9;p=platform%2Fupstream%2Fgit.git diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh index 08aa24c..8c739c9 100755 --- a/t/t1450-fsck.sh +++ b/t/t1450-fsck.sh @@ -142,6 +142,20 @@ test_expect_success '> in name is reported' ' grep "error in commit $new" out ' +# date is 2^64 + 1 +test_expect_success 'integer overflow in timestamps is reported' ' + git cat-file commit HEAD >basis && + sed "s/^\\(author .*>\\) [0-9]*/\\1 18446744073709551617/" \ + bad-timestamp && + new=$(git hash-object -t commit -w --stdin out && + cat out && + grep "error in commit $new.*integer overflow" out +' + test_expect_success 'tag pointing to nonexistent' ' cat >invalid-tag <<-\EOF && object ffffffffffffffffffffffffffffffffffffffff @@ -237,4 +251,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