Add test for rebase -i with commits that do not pass pre-commit
This accompanies c5b09feb786f6a2456ec3d8203d0f4d67f09f043 (Avoid update hook during git-rebase --interactive) to make sure that any regression to make Debian's Bug#458782 (git-core: git-rebase doesn't work when trying to squash changes into commits created with --no-verify) resurface will be caught. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin committed
Jan 28, 2008 at 16:33 UTC
752527f51396886c4ca11a14bfcecf2167ed4c40
1 file changed
+16
t/t3404-rebase-interactive.sh
+16
@@ -324,4 +324,20 @@ test_expect_success 'rebase a detached HEAD' '
324
test $grandparent = $(git rev-parse HEAD~2)
325
'
326
327
+test_expect_success 'rebase a commit violating pre-commit' '
328
+
329
+ mkdir -p .git/hooks &&
330
+ PRE_COMMIT=.git/hooks/pre-commit &&
331
+ echo "#!/bin/sh" > $PRE_COMMIT &&
332
+ echo "test -z \"\$(git diff --cached --check)\"" >> $PRE_COMMIT &&
333
+ chmod a+x $PRE_COMMIT &&
334
+ echo "monde! " >> file1 &&
335
+ test_tick &&
336
+ ! git commit -m doesnt-verify file1 &&
337
+ git commit -m doesnt-verify --no-verify file1 &&
338
+ test_tick &&
339
+ FAKE_LINES=2 git rebase -i HEAD~2
340
+
341
+'
342
+
343
test_done