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 <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin committed
Jul 14, 2017 at 16:45 UTC
47d4ac019bbd176730e538b68bae51f65eead4b3
1 file changed
+4
-18
t/t3404-rebase-interactive.sh
+4
-18
@@ -1249,20 +1249,13 @@ test_expect_success 'rebase -i respects rebase.missingCommitsCheck = error' '
1249
test B = $(git cat-file commit HEAD^ | sed -ne \$p)
1250
'
1251
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
-
1252
test_expect_success 'static check of bad command' '
1253
rebase_setup_and_clean bad-cmd &&
1254
set_fake_editor &&
1255
test_must_fail env FAKE_LINES="1 2 3 bad 4 5" \
1256
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 &&
1259
FAKE_LINES="1 2 3 drop 4 5" git rebase --edit-todo &&
1260
git rebase --continue &&
1261
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' '
1277
test E = $(git cat-file commit HEAD | sed -ne \$p)
1278
'
1279
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
-
1280
test_expect_success 'static check of bad SHA-1' '
1281
rebase_setup_and_clean bad-sha &&
1282
set_fake_editor &&
1283
test_must_fail env FAKE_LINES="1 2 edit fakesha 3 4 5 #" \
1284
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 &&
1287
FAKE_LINES="1 2 4 5 6" git rebase --edit-todo &&
1288
git rebase --continue &&
1289
test E = $(git cat-file commit HEAD | sed -ne \$p)