Skip to content

Commit 077b979

Browse files
szedergitster
authored andcommitted
t3404: make the 'rebase.missingCommitsCheck=ignore' test more focused
The test 'rebase -i respects rebase.missingCommitsCheck = warn' is mainly interested in the warning about the dropped commits, but it checks the whole output of 'git rebase', including progress lines and what not that are not at all relevant to 'rebase.missingCommitsCheck', but make it necessary to update this test whenever e.g. the way we show progress is updated (as it will happen in one of the later patches of this series). Modify the test to verify only the first four lines of 'git rebase's output that contain all the important lines, notably the line containing the "Warning:" itself and the oneline log of the dropped commit. Signed-off-by: SZEDER Gábor <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c9749b3 commit 077b979

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

t/t3404-rebase-interactive.sh

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,32 +1299,19 @@ test_expect_success 'rebase -i respects rebase.missingCommitsCheck = ignore' '
12991299
actual
13001300
'
13011301

1302-
cr_to_nl () {
1303-
tr '\015' '\012'
1304-
}
1305-
13061302
test_expect_success 'rebase -i respects rebase.missingCommitsCheck = warn' '
13071303
cat >expect <<-EOF &&
13081304
Warning: some commits may have been dropped accidentally.
13091305
Dropped commits (newer to older):
13101306
- $(git rev-list --pretty=oneline --abbrev-commit -1 master)
13111307
To avoid this message, use "drop" to explicitly remove a commit.
1312-
1313-
Use '\''git config rebase.missingCommitsCheck'\'' to change the level of warnings.
1314-
The possible behaviours are: ignore, warn, error.
1315-
1316-
Rebasing (1/4)
1317-
Rebasing (2/4)
1318-
Rebasing (3/4)
1319-
Rebasing (4/4)
1320-
Successfully rebased and updated refs/heads/missing-commit.
13211308
EOF
13221309
test_config rebase.missingCommitsCheck warn &&
13231310
rebase_setup_and_clean missing-commit &&
13241311
set_fake_editor &&
13251312
FAKE_LINES="1 2 3 4" \
13261313
git rebase -i --root 2>actual.2 &&
1327-
cr_to_nl <actual.2 >actual &&
1314+
head -n4 actual.2 >actual &&
13281315
test_i18ncmp expect actual &&
13291316
test D = $(git cat-file commit HEAD | sed -ne \$p)
13301317
'

0 commit comments

Comments
 (0)