Skip to content

Commit b2f3188

Browse files
committed
t3404: relax rebase.missingCommitsCheck tests
These tests were a bit anal about the *exact* warning/error message printed by git rebase. But those messages are intended for the *end user*, therefore it does not make sense to test so rigidly for the *exact* wording. In the following, we will reimplement the missing commits check in the sequencer, with slightly different words. So let's just test for the parts in the warning/error message that we *really* care about, nothing more, nothing less. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent fe53c10 commit b2f3188

File tree

1 file changed

+4
-18
lines changed

1 file changed

+4
-18
lines changed

t/t3404-rebase-interactive.sh

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,20 +1215,13 @@ test_expect_success 'rebase -i respects rebase.missingCommitsCheck = error' '
12151215
test B = $(git cat-file commit HEAD^ | sed -ne \$p)
12161216
'
12171217

1218-
cat >expect <<EOF
1219-
Warning: the command isn't recognized in the following line:
1220-
- badcmd $(git rev-list --oneline -1 master~1)
1221-
1222-
You can fix this with 'git rebase --edit-todo'.
1223-
Or you can abort the rebase with 'git rebase --abort'.
1224-
EOF
1225-
12261218
test_expect_success 'static check of bad command' '
12271219
rebase_setup_and_clean bad-cmd &&
12281220
set_fake_editor &&
12291221
test_must_fail env FAKE_LINES="1 2 3 bad 4 5" \
12301222
git rebase -i --root 2>actual &&
1231-
test_i18ncmp expect actual &&
1223+
test_i18ngrep "badcmd $(git rev-list --oneline -1 master~1)" actual &&
1224+
test_i18ngrep "You can fix this with .git rebase --edit-todo.." actual &&
12321225
FAKE_LINES="1 2 3 drop 4 5" git rebase --edit-todo &&
12331226
git rebase --continue &&
12341227
test E = $(git cat-file commit HEAD | sed -ne \$p) &&
@@ -1250,20 +1243,13 @@ test_expect_success 'tabs and spaces are accepted in the todolist' '
12501243
test E = $(git cat-file commit HEAD | sed -ne \$p)
12511244
'
12521245

1253-
cat >expect <<EOF
1254-
Warning: the SHA-1 is missing or isn't a commit in the following line:
1255-
- edit XXXXXXX False commit
1256-
1257-
You can fix this with 'git rebase --edit-todo'.
1258-
Or you can abort the rebase with 'git rebase --abort'.
1259-
EOF
1260-
12611246
test_expect_success 'static check of bad SHA-1' '
12621247
rebase_setup_and_clean bad-sha &&
12631248
set_fake_editor &&
12641249
test_must_fail env FAKE_LINES="1 2 edit fakesha 3 4 5 #" \
12651250
git rebase -i --root 2>actual &&
1266-
test_i18ncmp expect actual &&
1251+
test_i18ngrep "edit XXXXXXX False commit" actual &&
1252+
test_i18ngrep "You can fix this with .git rebase --edit-todo.." actual &&
12671253
FAKE_LINES="1 2 4 5 6" git rebase --edit-todo &&
12681254
git rebase --continue &&
12691255
test E = $(git cat-file commit HEAD | sed -ne \$p)

0 commit comments

Comments
 (0)