[PATCH] Test atomic git-commit --interactive

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

 



Signed-off-by: Conrad Irwin <conrad.irwin@xxxxxxxxx>
---
 t/t7501-commit.sh |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh
index a76c474..2a4e453 100755
--- a/t/t7501-commit.sh
+++ b/t/t7501-commit.sh
@@ -130,6 +130,15 @@ test_expect_success PERL \
 	"interactive add" \
 	"echo 7 | git commit --interactive | grep 'What now'"
 
+test_expect_success PERL \
+	"--interactive doesn't change index if editor aborts" \
+	"EDITOR=false echo zoo >file && \
+	test_must_fail git diff --exit-code > diff1 && \
+	(echo u ; echo '*' ; echo q) |\
+	test_must_fail git commit --interactive && \
+	git diff > diff2 && \
+	git diff --no-index diff1 diff2"
+
 test_expect_success \
 	"showing committed revisions" \
 	"git rev-list HEAD >current"
-- 
1.7.5.188.g4817

--
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]