OSDN Git Service

rebase -i: we allow extra spaces after fixup!/squash!
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Thu, 7 Jul 2016 15:52:57 +0000 (17:52 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 7 Jul 2016 22:40:59 +0000 (15:40 -0700)
This new test case ensures that we handle commit messages that start
with fixup! or squash! followed by more than one space. While we do
not generate such messages when committing with --fixup/--squash, it
is perfectly legal for users to hand-craft their own fixup messages,
and we heed Postel's law by being lenient.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t3415-rebase-autosquash.sh

index 9b71a49..48346f1 100755 (executable)
@@ -295,4 +295,13 @@ test_expect_failure 'autosquash with multiple empty patches' '
        )
 '
 
+test_expect_success 'extra spaces after fixup!' '
+       base=$(git rev-parse HEAD) &&
+       test_commit to-fixup &&
+       git commit --allow-empty -m "fixup!  to-fixup" &&
+       git rebase -i --autosquash --keep-empty HEAD~2 &&
+       parent=$(git rev-parse HEAD^) &&
+       test $base = $parent
+'
+
 test_done