Skip to content

Commit 84156d1

Browse files
dschogitster
authored andcommitted
t3415: test fixup with wrapped oneline
The `git commit --fixup` command unwraps wrapped onelines when constructing the commit message, without wrapping the result. We need to make sure that `git rebase --autosquash` keeps handling such cases correctly, in particular since we are about to move the autosquash handling into the rebase--helper. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 09812a3 commit 84156d1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

t/t3415-rebase-autosquash.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,4 +304,18 @@ test_expect_success 'extra spaces after fixup!' '
304304
test $base = $parent
305305
'
306306

307+
test_expect_success 'wrapped original subject' '
308+
if test -d .git/rebase-merge; then git rebase --abort; fi &&
309+
base=$(git rev-parse HEAD) &&
310+
echo "wrapped subject" >wrapped &&
311+
git add wrapped &&
312+
test_tick &&
313+
git commit --allow-empty -m "$(printf "To\nfixup")" &&
314+
test_tick &&
315+
git commit --allow-empty -m "fixup! To fixup" &&
316+
git rebase -i --autosquash --keep-empty HEAD~2 &&
317+
parent=$(git rev-parse HEAD^) &&
318+
test $base = $parent
319+
'
320+
307321
test_done

0 commit comments

Comments
 (0)