Skip to content

Commit 47d4ac0

Browse files
dschogitster
authored andcommitted
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]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3546c8d commit 47d4ac0

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
@@ -1249,20 +1249,13 @@ test_expect_success 'rebase -i respects rebase.missingCommitsCheck = error' '
12491249
test B = $(git cat-file commit HEAD^ | sed -ne \$p)
12501250
'
12511251

1252-
cat >expect <<EOF
1253-
Warning: the command isn't recognized in the following line:
1254-
- badcmd $(git rev-list --oneline -1 master~1)
1255-
1256-
You can fix this with 'git rebase --edit-todo' and then run 'git rebase --continue'.
1257-
Or you can abort the rebase with 'git rebase --abort'.
1258-
EOF
1259-
12601252
test_expect_success 'static check of bad command' '
12611253
rebase_setup_and_clean bad-cmd &&
12621254
set_fake_editor &&
12631255
test_must_fail env FAKE_LINES="1 2 3 bad 4 5" \
12641256
git rebase -i --root 2>actual &&
1265-
test_i18ncmp expect actual &&
1257+
test_i18ngrep "badcmd $(git rev-list --oneline -1 master~1)" actual &&
1258+
test_i18ngrep "You can fix this with .git rebase --edit-todo.." actual &&
12661259
FAKE_LINES="1 2 3 drop 4 5" git rebase --edit-todo &&
12671260
git rebase --continue &&
12681261
test E = $(git cat-file commit HEAD | sed -ne \$p) &&
@@ -1284,20 +1277,13 @@ test_expect_success 'tabs and spaces are accepted in the todolist' '
12841277
test E = $(git cat-file commit HEAD | sed -ne \$p)
12851278
'
12861279

1287-
cat >expect <<EOF
1288-
Warning: the SHA-1 is missing or isn't a commit in the following line:
1289-
- edit XXXXXXX False commit
1290-
1291-
You can fix this with 'git rebase --edit-todo' and then run 'git rebase --continue'.
1292-
Or you can abort the rebase with 'git rebase --abort'.
1293-
EOF
1294-
12951280
test_expect_success 'static check of bad SHA-1' '
12961281
rebase_setup_and_clean bad-sha &&
12971282
set_fake_editor &&
12981283
test_must_fail env FAKE_LINES="1 2 edit fakesha 3 4 5 #" \
12991284
git rebase -i --root 2>actual &&
1300-
test_i18ncmp expect actual &&
1285+
test_i18ngrep "edit XXXXXXX False commit" actual &&
1286+
test_i18ngrep "You can fix this with .git rebase --edit-todo.." actual &&
13011287
FAKE_LINES="1 2 4 5 6" git rebase --edit-todo &&
13021288
git rebase --continue &&
13031289
test E = $(git cat-file commit HEAD | sed -ne \$p)

0 commit comments

Comments
 (0)