diff options
author | Junio C Hamano <gitster@pobox.com> | 2023-10-31 08:23:30 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-11-02 11:13:44 +0300 |
commit | 6789275d3780bcb950e6be8557aeedf160d4ad6d (patch) | |
tree | 24c1fcc6ee63c63284e507b05e3332eb6f6d5537 /t/t3404-rebase-interactive.sh | |
parent | 2e87fca189e613912b085c5140312b1f4b3f2977 (diff) |
tests: teach callers of test_i18ngrep to use test_grep
They are equivalents and the former still exists, so as long as the
only change this commit makes are to rewrite test_i18ngrep to
test_grep, there won't be any new bug, even if there still are
callers of test_i18ngrep remaining in the tree, or when merged to
other topics that add new uses of test_i18ngrep.
This patch was produced more or less with
git grep -l -e 'test_i18ngrep ' 't/t[0-9][0-9][0-9][0-9]-*.sh' |
xargs perl -p -i -e 's/test_i18ngrep /test_grep /'
and a good way to sanity check the result yourself is to run the
above in a checkout of c4603c1c (test framework: further deprecate
test_i18ngrep, 2023-10-31) and compare the resulting working tree
contents with the result of applying this patch to the same commit.
You'll see that test_i18ngrep in a few t/lib-*.sh files corrected,
in addition to the manual reproduction.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3404-rebase-interactive.sh')
-rwxr-xr-x | t/t3404-rebase-interactive.sh | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh index 96a56aafbe..dbd5df5aa4 100755 --- a/t/t3404-rebase-interactive.sh +++ b/t/t3404-rebase-interactive.sh @@ -291,9 +291,9 @@ test_expect_success 'abort with error when new base cannot be checked out' ' git rm --cached file1 && git commit -m "remove file in base" && test_must_fail git rebase -i primary > output 2>&1 && - test_i18ngrep "The following untracked working tree files would be overwritten by checkout:" \ + test_grep "The following untracked working tree files would be overwritten by checkout:" \ output && - test_i18ngrep "file1" output && + test_grep "file1" output && test_path_is_missing .git/rebase-merge && rm file1 && git reset --hard HEAD^ @@ -604,7 +604,7 @@ test_expect_success 'clean error after failed "exec"' ' echo "edited again" > file7 && git add file7 && test_must_fail git rebase --continue 2>error && - test_i18ngrep "you have staged changes in your working tree" error + test_grep "you have staged changes in your working tree" error ' test_expect_success 'rebase a detached HEAD' ' @@ -955,7 +955,7 @@ test_expect_success 'rebase --exec works without -i ' ' git reset --hard execute && rm -rf exec_output && EDITOR="echo >invoked_editor" git rebase --exec "echo a line >>exec_output" HEAD~2 2>actual && - test_i18ngrep "Successfully rebased and updated" actual && + test_grep "Successfully rebased and updated" actual && test_line_count = 2 exec_output && test_path_is_missing invoked_editor ' @@ -963,7 +963,7 @@ test_expect_success 'rebase --exec works without -i ' ' test_expect_success 'rebase -i --exec without <CMD>' ' git reset --hard execute && test_must_fail git rebase -i --exec 2>actual && - test_i18ngrep "requires a value" actual && + test_grep "requires a value" actual && git checkout primary ' @@ -1272,7 +1272,7 @@ test_expect_success 'todo count' ' test_set_editor "$(pwd)/dump-raw.sh" && git rebase -i HEAD~4 >actual ) && - test_i18ngrep "^# Rebase ..* onto ..* ([0-9]" actual + test_grep "^# Rebase ..* onto ..* ([0-9]" actual ' test_expect_success 'rebase -i commits that overwrite untracked files (pick)' ' @@ -1379,7 +1379,7 @@ test_expect_success 'rebase -i respects rebase.missingCommitsCheck = ignore' ' FAKE_LINES="1 2 3 4" git rebase -i --root 2>actual ) && test D = $(git cat-file commit HEAD | sed -ne \$p) && - test_i18ngrep \ + test_grep \ "Successfully rebased and updated refs/heads/missing-commit" \ actual ' @@ -1442,7 +1442,7 @@ test_expect_success 'rebase --edit-todo respects rebase.missingCommitsCheck = ig git rebase --continue 2>actual ) && test D = $(git cat-file commit HEAD | sed -ne \$p) && - test_i18ngrep \ + test_grep \ "Successfully rebased and updated refs/heads/missing-commit" \ actual ' @@ -1477,7 +1477,7 @@ test_expect_success 'rebase --edit-todo respects rebase.missingCommitsCheck = wa git rebase --continue 2>actual ) && test D = $(git cat-file commit HEAD | sed -ne \$p) && - test_i18ngrep \ + test_grep \ "Successfully rebased and updated refs/heads/missing-commit" \ actual ' @@ -1525,7 +1525,7 @@ test_expect_success 'rebase --edit-todo respects rebase.missingCommitsCheck = er git rebase --continue 2>actual ) && test D = $(git cat-file commit HEAD | sed -ne \$p) && - test_i18ngrep \ + test_grep \ "Successfully rebased and updated refs/heads/missing-commit" \ actual ' @@ -1585,9 +1585,9 @@ test_expect_success 'static check of bad command' ' set_fake_editor && test_must_fail env FAKE_LINES="1 2 3 bad 4 5" \ git rebase -i --root 2>actual && - test_i18ngrep "pickled $(git rev-list --oneline -1 primary~1)" \ + test_grep "pickled $(git rev-list --oneline -1 primary~1)" \ actual && - test_i18ngrep "You can fix this with .git rebase --edit-todo.." \ + test_grep "You can fix this with .git rebase --edit-todo.." \ actual && FAKE_LINES="1 2 3 drop 4 5" git rebase --edit-todo ) && @@ -1645,8 +1645,8 @@ test_expect_success 'static check of bad SHA-1' ' set_fake_editor && test_must_fail env FAKE_LINES="1 2 edit fakesha 3 4 5 #" \ git rebase -i --root 2>actual && - test_i18ngrep "edit XXXXXXX False commit" actual && - test_i18ngrep "You can fix this with .git rebase --edit-todo.." \ + test_grep "edit XXXXXXX False commit" actual && + test_grep "You can fix this with .git rebase --edit-todo.." \ actual && FAKE_LINES="1 2 4 5 6" git rebase --edit-todo ) && @@ -1673,7 +1673,7 @@ test_expect_success 'rebase -i --gpg-sign=<key-id>' ' FAKE_LINES="edit 1" git rebase -i --gpg-sign="\"S I Gner\"" \ HEAD^ >out 2>err ) && - test_i18ngrep "$SQ-S\"S I Gner\"$SQ" err + test_grep "$SQ-S\"S I Gner\"$SQ" err ' test_expect_success 'rebase -i --gpg-sign=<key-id> overrides commit.gpgSign' ' @@ -1684,7 +1684,7 @@ test_expect_success 'rebase -i --gpg-sign=<key-id> overrides commit.gpgSign' ' FAKE_LINES="edit 1" git rebase -i --gpg-sign="\"S I Gner\"" \ HEAD^ >out 2>err ) && - test_i18ngrep "$SQ-S\"S I Gner\"$SQ" err + test_grep "$SQ-S\"S I Gner\"$SQ" err ' test_expect_success 'valid author header after --root swap' ' @@ -1738,7 +1738,7 @@ test_expect_success 'correct error message for partial commit after empty pick' ) && echo x >file1 && test_must_fail git commit file1 2>err && - test_i18ngrep "cannot do a partial commit during a rebase." err + test_grep "cannot do a partial commit during a rebase." err ' test_expect_success 'correct error message for commit --amend after empty pick' ' @@ -1751,13 +1751,13 @@ test_expect_success 'correct error message for commit --amend after empty pick' ) && echo x>file1 && test_must_fail git commit -a --amend 2>err && - test_i18ngrep "middle of a rebase -- cannot amend." err + test_grep "middle of a rebase -- cannot amend." err ' test_expect_success 'todo has correct onto hash' ' GIT_SEQUENCE_EDITOR=cat git rebase -i no-conflict-branch~4 no-conflict-branch >actual && onto=$(git rev-parse --short HEAD~4) && - test_i18ngrep "^# Rebase ..* onto $onto" actual + test_grep "^# Rebase ..* onto $onto" actual ' test_expect_success 'ORIG_HEAD is updated correctly' ' |