From: Junio C Hamano Date: Mon, 8 Oct 2012 18:43:10 +0000 (-0700) Subject: Merge branch 'jc/maint-t1450-fsck-order-fix' X-Git-Tag: v1.8.0-rc1~1 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/d519e4594c17ea30e33432dd712d2d0887aaf8c7?ds=inline;hp=-c Merge branch 'jc/maint-t1450-fsck-order-fix' The fsck test assumed too much on what kind of error it will detect. The only important thing is the inconsistency is detected as an error. * jc/maint-t1450-fsck-order-fix: t1450: the order the objects are checked is undefined --- d519e4594c17ea30e33432dd712d2d0887aaf8c7 diff --combined t/t1450-fsck.sh index bf7a2cd6fb,9c64eefbb3..08aa24ca15 --- a/t/t1450-fsck.sh +++ b/t/t1450-fsck.sh @@@ -177,9 -177,7 +177,7 @@@ test_expect_success 'tag pointing to so 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' ' @@@ -213,30 -211,4 +211,30 @@@ test_expect_success 'rev-list --verify- grep -q "error: sha1 mismatch 63ffffffffffffffffffffffffffffffffffffff" out ' +_bz='\0' +_bz5="$_bz$_bz$_bz$_bz$_bz" +_bz20="$_bz5$_bz5$_bz5$_bz5" + +test_expect_success 'fsck notices blob entry pointing to null sha1' ' + (git init null-blob && + cd null-blob && + sha=$(printf "100644 file$_bz$_bz20" | + git hash-object -w --stdin -t tree) && + git fsck 2>out && + cat out && + grep "warning.*null sha1" out + ) +' + +test_expect_success 'fsck notices submodule entry pointing to null sha1' ' + (git init null-commit && + cd null-commit && + sha=$(printf "160000 submodule$_bz$_bz20" | + git hash-object -w --stdin -t tree) && + git fsck 2>out && + cat out && + grep "warning.*null sha1" out + ) +' + test_done