Merge branch 'jc/maint-t1450-fsck-order-fix'
authorJunio C Hamano <gitster@pobox.com>
Mon, 8 Oct 2012 18:43:10 +0000 (11:43 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 8 Oct 2012 18:43:10 +0000 (11:43 -0700)
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

1  2 
t/t1450-fsck.sh
diff --combined t/t1450-fsck.sh
index bf7a2cd6fb649e3b210b537d4d25312ba2921f16,9c64eefbb3b28305bf850752db3af963b90066f4..08aa24ca15a377826b9e1cdad73fb232853aea7f
@@@ -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