Skip to content

Commit 4e7524e

Browse files
dschogitster
authored andcommitted
t3415: verify that an empty instructionFormat is handled as before
An upcoming patch will move the todo list generation into the rebase--helper. An early version of that patch regressed on an empty rebase.instructionFormat value (the shell version could not discern between an empty one and a non-existing one, but the C version used the empty one as if that was intended to skip the oneline from the `pick <hash>` lines). Let's verify that this still works as before. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5800c63 commit 4e7524e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

t/t3415-rebase-autosquash.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,18 @@ test_expect_success C_LOCALE_OUTPUT 'autosquash with custom inst format' '
271271
test 2 = $(git cat-file commit HEAD^ | grep squash | wc -l)
272272
'
273273

274+
test_expect_success 'autosquash with empty custom instructionFormat' '
275+
git reset --hard base &&
276+
test_commit empty-instructionFormat-test &&
277+
(
278+
set_cat_todo_editor &&
279+
test_must_fail git -c rebase.instructionFormat= \
280+
rebase --autosquash --force -i HEAD^ >actual &&
281+
git log -1 --format="pick %h %s" >expect &&
282+
test_cmp expect actual
283+
)
284+
'
285+
274286
set_backup_editor () {
275287
write_script backup-editor.sh <<-\EOF
276288
cp "$1" .git/backup-"$(basename "$1")"

0 commit comments

Comments
 (0)