提交 752527f5 编写于 作者: J Johannes Schindelin 提交者: Junio C Hamano

Add test for rebase -i with commits that do not pass pre-commit

This accompanies c5b09feb (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: NJohannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 c0d45281
......@@ -324,4 +324,20 @@ test_expect_success 'rebase a detached HEAD' '
test $grandparent = $(git rev-parse HEAD~2)
'
test_expect_success 'rebase a commit violating pre-commit' '
mkdir -p .git/hooks &&
PRE_COMMIT=.git/hooks/pre-commit &&
echo "#!/bin/sh" > $PRE_COMMIT &&
echo "test -z \"\$(git diff --cached --check)\"" >> $PRE_COMMIT &&
chmod a+x $PRE_COMMIT &&
echo "monde! " >> file1 &&
test_tick &&
! git commit -m doesnt-verify file1 &&
git commit -m doesnt-verify --no-verify file1 &&
test_tick &&
FAKE_LINES=2 git rebase -i HEAD~2
'
test_done
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册