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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This accompanies c5b09feb(Avoid update hook during git-rebase --interactive)
to prove that Debian's Bug#458782 (git-core: git-rebase doesn't work when
trying to squash changes into commits created with --no-verify) is indeed
fixed now.

Signed-off-by: Johannes Schindelin <johannes.schindelin@xxxxxx>
---

	On Mon, 28 Jan 2008, Gerrit Pape wrote:

	> Hi, IIRC I managed to reproduce the problem below, but currently 
	> don't have the time to track it down.  Hopefully someone else 
	> can work on it, there's even a patch suggested.

	It is even in 1.5.4-rc1.

 t/t3404-rebase-interactive.sh |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 74a7eb3..e33ea4e 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -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
-- 
1.5.4.rc5.15.g8231f

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux