X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft1450-fsck.sh;h=759cf12e16bcddc3dab9d6b3ad8abd5590245a94;hb=a0b6a9d2b2b0667bc170c864a05b3ec4635a71bb;hp=49cae3ed524d70ae39114b35a95e7070f1a4e575;hpb=797d44343c831680aeae3392259fcadeb178bf61;p=git.git diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh index 49cae3ed5..759cf12e1 100755 --- a/t/t1450-fsck.sh +++ b/t/t1450-fsck.sh @@ -5,7 +5,9 @@ test_description='git fsck random collection of tests' . ./test-lib.sh test_expect_success setup ' + git config i18n.commitencoding ISO-8859-1 && test_commit A fileA one && + git config --unset i18n.commitencoding && git checkout HEAD^0 && test_commit B fileB two && git tag -d A B && @@ -28,6 +30,12 @@ test_expect_success 'loose objects borrowed from alternate are not missing' ' ) ' +test_expect_success 'valid objects appear valid' ' + { git fsck 2>out; true; } && + ! grep error out && + ! grep fatal out +' + # Corruption tests follow. Make sure to remove all traces of the # specific corruption you test afterwards, lest a later test trip over # it. @@ -57,6 +65,34 @@ test_expect_success 'branch pointing to non-commit' ' git update-ref -d refs/heads/invalid ' +new=nothing +test_expect_success 'email without @ is okay' ' + git cat-file commit HEAD >basis && + sed "s/@/AT/" basis >okay && + new=$(git hash-object -t commit -w --stdin out && + cat out && + ! grep "error in commit $new" out +' +git update-ref -d refs/heads/bogus +rm -f ".git/objects/$new" + +new=nothing +test_expect_success 'email with embedded > is not okay' ' + git cat-file commit HEAD >basis && + sed "s/@[a-z]/&>/" basis >bad-email && + new=$(git hash-object -t commit -w --stdin out && + cat out && + grep "error in commit $new" out +' +git update-ref -d refs/heads/bogus +rm -f ".git/objects/$new" + cat > invalid-tag <