Skip to content

Commit 975e774

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 df5263c commit 975e774

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

1245-
cat >expect <<EOF
1246-
Warning: the command isn't recognized in the following line:
1247-
- badcmd $(git rev-list --oneline -1 master~1)
1248-
1249-
You can fix this with 'git rebase --edit-todo' and then run 'git rebase --continue'.
1250-
Or you can abort the rebase with 'git rebase --abort'.
1251-
EOF
1252-
12531245
test_expect_success 'static check of bad command' '
12541246
rebase_setup_and_clean bad-cmd &&
12551247
set_fake_editor &&
12561248
test_must_fail env FAKE_LINES="1 2 3 bad 4 5" \
12571249
git rebase -i --root 2>actual &&
1258-
test_i18ncmp expect actual &&
1250+
test_i18ngrep "badcmd $(git rev-list --oneline -1 master~1)" actual &&
1251+
test_i18ngrep "You can fix this with .git rebase --edit-todo.." actual &&
12591252
FAKE_LINES="1 2 3 drop 4 5" git rebase --edit-todo &&
12601253
git rebase --continue &&
12611254
test E = $(git cat-file commit HEAD | sed -ne \$p) &&
@@ -1277,20 +1270,13 @@ test_expect_success 'tabs and spaces are accepted in the todolist' '
12771270
test E = $(git cat-file commit HEAD | sed -ne \$p)
12781271
'
12791272

1280-
cat >expect <<EOF
1281-
Warning: the SHA-1 is missing or isn't a commit in the following line:
1282-
- edit XXXXXXX False commit
1283-
1284-
You can fix this with 'git rebase --edit-todo' and then run 'git rebase --continue'.
1285-
Or you can abort the rebase with 'git rebase --abort'.
1286-
EOF
1287-
12881273
test_expect_success 'static check of bad SHA-1' '
12891274
rebase_setup_and_clean bad-sha &&
12901275
set_fake_editor &&
12911276
test_must_fail env FAKE_LINES="1 2 edit fakesha 3 4 5 #" \
12921277
git rebase -i --root 2>actual &&
1293-
test_i18ncmp expect actual &&
1278+
test_i18ngrep "edit XXXXXXX False commit" actual &&
1279+
test_i18ngrep "You can fix this with .git rebase --edit-todo.." actual &&
12941280
FAKE_LINES="1 2 4 5 6" git rebase --edit-todo &&
12951281
git rebase --continue &&
12961282
test E = $(git cat-file commit HEAD | sed -ne \$p)

0 commit comments

Comments
 (0)