Skip to content

Commit b174ae7

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 cdac2b0 commit b174ae7

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
@@ -316,4 +316,18 @@ test_expect_success 'extra spaces after fixup!' '
316316
test $base = $parent
317317
'
318318

319+
test_expect_success 'wrapped original subject' '
320+
if test -d .git/rebase-merge; then git rebase --abort; fi &&
321+
base=$(git rev-parse HEAD) &&
322+
echo "wrapped subject" >wrapped &&
323+
git add wrapped &&
324+
test_tick &&
325+
git commit --allow-empty -m "$(printf "To\nfixup")" &&
326+
test_tick &&
327+
git commit --allow-empty -m "fixup! To fixup" &&
328+
git rebase -i --autosquash --keep-empty HEAD~2 &&
329+
parent=$(git rev-parse HEAD^) &&
330+
test $base = $parent
331+
'
332+
319333
test_done

0 commit comments

Comments
 (0)