Test atomic git-commit --interactive
Signed-off-by: Conrad Irwin <conrad.irwin@gmail.com> Helped-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Conrad Irwin committed
May 10, 2011 at 12:12 UTC
02a481fc6aef5d8a52f900448657d1cbe7c963ef
1 file changed
+10
t/t7501-commit.sh
+10
@@ -133,6 +133,16 @@ test_expect_success PERL \
133
"interactive add" \
134
"echo 7 | git commit --interactive | grep 'What now'"
135
136
+test_expect_success PERL \
137
+ "commit --interactive doesn't change index if editor aborts" \
138
+ "echo zoo >file &&
139
+ test_must_fail git diff --exit-code >diff1 &&
140
+ (echo u ; echo '*' ; echo q) |
141
+ (EDITOR=: && export EDITOR &&
142
+ test_must_fail git commit --interactive) &&
143
+ git diff >diff2 &&
144
+ test_cmp diff1 diff2"
145
+
146
test_expect_success \
147
"showing committed revisions" \
148
"git rev-list HEAD >current"