diff options
Diffstat (limited to 't/t1450-fsck.sh')
| -rwxr-xr-x | t/t1450-fsck.sh | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh index 10a539158c..0e3e87d37a 100755 --- a/t/t1450-fsck.sh +++ b/t/t1450-fsck.sh @@ -118,7 +118,7 @@ test_expect_success 'branch pointing to non-commit' ' git rev-parse HEAD^{tree} >.git/refs/heads/invalid && test_when_finished "git update-ref -d refs/heads/invalid" && test_must_fail git fsck 2>out && - test_i18ngrep "not a commit" out + test_grep "not a commit" out ' test_expect_success 'HEAD link pointing at a funny object' ' @@ -127,7 +127,7 @@ test_expect_success 'HEAD link pointing at a funny object' ' echo $ZERO_OID >.git/HEAD && # avoid corrupt/broken HEAD from interfering with repo discovery test_must_fail env GIT_DIR=.git git fsck 2>out && - test_i18ngrep "detached HEAD points" out + test_grep "detached HEAD points" out ' test_expect_success 'HEAD link pointing at a funny place' ' @@ -136,7 +136,7 @@ test_expect_success 'HEAD link pointing at a funny place' ' echo "ref: refs/funny/place" >.git/HEAD && # avoid corrupt/broken HEAD from interfering with repo discovery test_must_fail env GIT_DIR=.git git fsck 2>out && - test_i18ngrep "HEAD points to something strange" out + test_grep "HEAD points to something strange" out ' test_expect_success 'HEAD link pointing at a funny object (from different wt)' ' @@ -147,7 +147,7 @@ test_expect_success 'HEAD link pointing at a funny object (from different wt)' ' echo $ZERO_OID >.git/HEAD && # avoid corrupt/broken HEAD from interfering with repo discovery test_must_fail git -C wt fsck 2>out && - test_i18ngrep "main-worktree/HEAD: detached HEAD points" out + test_grep "main-worktree/HEAD: detached HEAD points" out ' test_expect_success 'other worktree HEAD link pointing at a funny object' ' @@ -155,7 +155,7 @@ test_expect_success 'other worktree HEAD link pointing at a funny object' ' git worktree add other && echo $ZERO_OID >.git/worktrees/other/HEAD && test_must_fail git fsck 2>out && - test_i18ngrep "worktrees/other/HEAD: detached HEAD points" out + test_grep "worktrees/other/HEAD: detached HEAD points" out ' test_expect_success 'other worktree HEAD link pointing at missing object' ' @@ -163,7 +163,7 @@ test_expect_success 'other worktree HEAD link pointing at missing object' ' git worktree add other && echo "Contents missing from repo" | git hash-object --stdin >.git/worktrees/other/HEAD && test_must_fail git fsck 2>out && - test_i18ngrep "worktrees/other/HEAD: invalid sha1 pointer" out + test_grep "worktrees/other/HEAD: invalid sha1 pointer" out ' test_expect_success 'other worktree HEAD link pointing at a funny place' ' @@ -171,7 +171,7 @@ test_expect_success 'other worktree HEAD link pointing at a funny place' ' git worktree add other && echo "ref: refs/funny/place" >.git/worktrees/other/HEAD && test_must_fail git fsck 2>out && - test_i18ngrep "worktrees/other/HEAD points to something strange" out + test_grep "worktrees/other/HEAD points to something strange" out ' test_expect_success 'commit with multiple signatures is okay' ' @@ -217,7 +217,7 @@ test_expect_success 'email with embedded > is not okay' ' git update-ref refs/heads/bogus "$new" && test_when_finished "git update-ref -d refs/heads/bogus" && test_must_fail git fsck 2>out && - test_i18ngrep "error in commit $new" out + test_grep "error in commit $new" out ' test_expect_success 'missing < email delimiter is reported nicely' ' @@ -228,7 +228,7 @@ test_expect_success 'missing < email delimiter is reported nicely' ' git update-ref refs/heads/bogus "$new" && test_when_finished "git update-ref -d refs/heads/bogus" && test_must_fail git fsck 2>out && - test_i18ngrep "error in commit $new.* - bad name" out + test_grep "error in commit $new.* - bad name" out ' test_expect_success 'missing email is reported nicely' ' @@ -239,7 +239,7 @@ test_expect_success 'missing email is reported nicely' ' git update-ref refs/heads/bogus "$new" && test_when_finished "git update-ref -d refs/heads/bogus" && test_must_fail git fsck 2>out && - test_i18ngrep "error in commit $new.* - missing email" out + test_grep "error in commit $new.* - missing email" out ' test_expect_success '> in name is reported' ' @@ -250,7 +250,7 @@ test_expect_success '> in name is reported' ' git update-ref refs/heads/bogus "$new" && test_when_finished "git update-ref -d refs/heads/bogus" && test_must_fail git fsck 2>out && - test_i18ngrep "error in commit $new" out + test_grep "error in commit $new" out ' # date is 2^64 + 1 @@ -263,7 +263,7 @@ test_expect_success 'integer overflow in timestamps is reported' ' git update-ref refs/heads/bogus "$new" && test_when_finished "git update-ref -d refs/heads/bogus" && test_must_fail git fsck 2>out && - test_i18ngrep "error in commit $new.*integer overflow" out + test_grep "error in commit $new.*integer overflow" out ' test_expect_success 'commit with NUL in header' ' @@ -274,7 +274,7 @@ test_expect_success 'commit with NUL in header' ' git update-ref refs/heads/bogus "$new" && test_when_finished "git update-ref -d refs/heads/bogus" && test_must_fail git fsck 2>out && - test_i18ngrep "error in commit $new.*unterminated header: NUL at offset" out + test_grep "error in commit $new.*unterminated header: NUL at offset" out ' test_expect_success 'tree object with duplicate entries' ' @@ -295,7 +295,7 @@ test_expect_success 'tree object with duplicate entries' ' git hash-object --literally -w -t tree --stdin ) && test_must_fail git fsck 2>out && - test_i18ngrep "error in tree .*contains duplicate file entries" out + test_grep "error in tree .*contains duplicate file entries" out ' check_duplicate_names () { @@ -318,8 +318,8 @@ check_duplicate_names () { done >badtree && badtree=$(git mktree <badtree) && test_must_fail git fsck 2>out && - test_i18ngrep "$badtree" out && - test_i18ngrep "error in tree .*contains duplicate file entries" out + test_grep "$badtree" out && + test_grep "error in tree .*contains duplicate file entries" out ' } @@ -341,9 +341,9 @@ test_expect_success 'unparseable tree object' ' commit_sha1=$(git commit-tree $tree_sha1) && git update-ref refs/heads/wrong $commit_sha1 && test_must_fail git fsck 2>out && - test_i18ngrep "error: empty filename in tree entry" out && - test_i18ngrep "$tree_sha1" out && - test_i18ngrep ! "fatal: empty filename in tree entry" out + test_grep "error: empty filename in tree entry" out && + test_grep "$tree_sha1" out && + test_grep ! "fatal: empty filename in tree entry" out ' test_expect_success 'tree entry with type mismatch' ' @@ -360,8 +360,8 @@ test_expect_success 'tree entry with type mismatch' ' commit=$(git commit-tree $tree) && git update-ref refs/heads/type_mismatch $commit && test_must_fail git fsck >out 2>&1 && - test_i18ngrep "is a blob, not a tree" out && - test_i18ngrep ! "dangling blob" out + test_grep "is a blob, not a tree" out && + test_grep ! "dangling blob" out ' test_expect_success 'tree entry with bogus mode' ' @@ -394,7 +394,7 @@ test_expect_success 'tag pointing to nonexistent' ' echo $tag >.git/refs/tags/invalid && test_when_finished "git update-ref -d refs/tags/invalid" && test_must_fail git fsck --tags >out && - test_i18ngrep "broken link" out + test_grep "broken link" out ' test_expect_success 'tag pointing to something else than its type' ' @@ -455,7 +455,7 @@ test_expect_success 'tag with bad tagger' ' echo $tag >.git/refs/tags/wrong && test_when_finished "git update-ref -d refs/tags/wrong" && test_must_fail git fsck --tags 2>out && - test_i18ngrep "error in tag .*: invalid author/committer" out + test_grep "error in tag .*: invalid author/committer" out ' test_expect_success 'tag with NUL in header' ' @@ -474,7 +474,7 @@ test_expect_success 'tag with NUL in header' ' echo $tag >.git/refs/tags/wrong && test_when_finished "git update-ref -d refs/tags/wrong" && test_must_fail git fsck --tags 2>out && - test_i18ngrep "error in tag $tag.*unterminated header: NUL at offset" out + test_grep "error in tag $tag.*unterminated header: NUL at offset" out ' test_expect_success 'cleaned up' ' @@ -504,7 +504,7 @@ test_expect_success 'rev-list --verify-objects with bad sha1' ' test_when_finished "git update-ref -d refs/heads/bogus" && test_might_fail git rev-list --verify-objects refs/heads/bogus >/dev/null 2>out && - test_i18ngrep -q "error: hash mismatch $(dirname $new)$(test_oid ff_2)" out + test_grep -q "error: hash mismatch $(dirname $new)$(test_oid ff_2)" out ' # An actual bit corruption is more likely than swapped commits, but @@ -575,7 +575,7 @@ test_expect_success 'fsck notices blob entry pointing to null sha1' ' sha=$(printf "100644 file$_bz$_bzoid" | git hash-object --literally -w --stdin -t tree) && git fsck 2>out && - test_i18ngrep "warning.*null sha1" out + test_grep "warning.*null sha1" out ) ' @@ -585,7 +585,7 @@ test_expect_success 'fsck notices submodule entry pointing to null sha1' ' sha=$(printf "160000 submodule$_bz$_bzoid" | git hash-object --literally -w --stdin -t tree) && git fsck 2>out && - test_i18ngrep "warning.*null sha1" out + test_grep "warning.*null sha1" out ) ' @@ -616,7 +616,7 @@ while read name path pretty; do printf "$mode $type %s\t%s" "$value" "$path" >bad && bad_tree=$(git mktree <bad) && git fsck 2>out && - test_i18ngrep "warning.*tree $bad_tree" out + test_grep "warning.*tree $bad_tree" out )' done <<-\EOF 100644 blob @@ -662,9 +662,9 @@ test_expect_success 'NUL in commit' ' git branch bad $(cat name) && test_must_fail git -c fsck.nulInCommit=error fsck 2>warn.1 && - test_i18ngrep nulInCommit warn.1 && + test_grep nulInCommit warn.1 && git fsck 2>warn.2 && - test_i18ngrep nulInCommit warn.2 + test_grep nulInCommit warn.2 ) ' @@ -784,7 +784,7 @@ test_expect_success 'fsck --name-objects' ' tree=$(git rev-parse --verify julius:) && git tag -d julius && test_must_fail git fsck --name-objects >out && - test_i18ngrep "$tree (refs/tags/augustus44\\^:" out + test_grep "$tree (refs/tags/augustus44\\^:" out ) ' @@ -797,7 +797,7 @@ test_expect_success 'alternate objects are correctly blamed' ' mkdir alt.git/objects/$(dirname $path) && >alt.git/objects/$(dirname $path)/$(basename $path) && test_must_fail git fsck >out 2>&1 && - test_i18ngrep alt.git out + test_grep alt.git out ' test_expect_success 'fsck errors in packed objects' ' @@ -816,8 +816,8 @@ test_expect_success 'fsck errors in packed objects' ' remove_object $one && remove_object $two && test_must_fail git fsck 2>out && - test_i18ngrep "error in commit $one.* - bad name" out && - test_i18ngrep "error in commit $two.* - bad name" out && + test_grep "error in commit $one.* - bad name" out && + test_grep "error in commit $two.* - bad name" out && ! grep corrupt out ' @@ -834,7 +834,7 @@ test_expect_success 'fsck fails on corrupt packfile' ' test_when_finished "rm -f .git/objects/pack/pack-$pack.*" && remove_object $hsh && test_must_fail git fsck 2>out && - test_i18ngrep "checksum mismatch" out + test_grep "checksum mismatch" out ' test_expect_success 'fsck finds problems in duplicate loose objects' ' @@ -871,7 +871,7 @@ test_expect_success 'fsck detects trailing loose garbage (commit)' ' chmod +w "$file" && echo garbage >>"$file" && test_must_fail git fsck 2>out && - test_i18ngrep "garbage.*$commit" out + test_grep "garbage.*$commit" out ' test_expect_success 'fsck detects trailing loose garbage (large blob)' ' @@ -881,7 +881,7 @@ test_expect_success 'fsck detects trailing loose garbage (large blob)' ' chmod +w "$file" && echo garbage >>"$file" && test_must_fail git -c core.bigfilethreshold=5 fsck 2>out && - test_i18ngrep "garbage.*$blob" out + test_grep "garbage.*$blob" out ' test_expect_success 'fsck detects truncated loose object' ' @@ -897,10 +897,10 @@ test_expect_success 'fsck detects truncated loose object' ' # check both regular and streaming code paths test_must_fail git fsck 2>out && - test_i18ngrep corrupt.*$blob out && + test_grep corrupt.*$blob out && test_must_fail git -c core.bigfilethreshold=128 fsck 2>out && - test_i18ngrep corrupt.*$blob out + test_grep corrupt.*$blob out ' # for each of type, we have one version which is referenced by another object @@ -989,7 +989,7 @@ test_expect_success 'detect corrupt index file in fsck' ' test_when_finished "mv .git/index.backup .git/index" && corrupt_index_checksum && test_must_fail git fsck --cache 2>errors && - test_i18ngrep "bad index file" errors + test_grep "bad index file" errors ' test_expect_success 'fsck error and recovery on invalid object type' ' |
