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 <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin committed
Jul 14, 2017 at 16:45 UTC
b174ae7df2aa196beefca605f2df778ad15b6ad7
1 file changed
+14
t/t3415-rebase-autosquash.sh
+14
@@ -316,4 +316,18 @@ test_expect_success 'extra spaces after fixup!' '
316
test $base = $parent
317
'
318
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
+
333
test_done