summaryrefslogtreecommitdiff
path: root/t/t7501-commit.sh
diff options
context:
space:
mode:
authorConrad Irwin <conrad.irwin@gmail.com>2011-05-10 19:12:31 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-05-10 20:04:00 (GMT)
commit02a481fc6aef5d8a52f900448657d1cbe7c963ef (patch)
treed51980f5ef70634df1027aaeb292164cc6f2cf7e /t/t7501-commit.sh
parente6b57a8a4ec6c7522facafe30409ecd2d6b181ba (diff)
downloadgit-02a481fc6aef5d8a52f900448657d1cbe7c963ef.zip
git-02a481fc6aef5d8a52f900448657d1cbe7c963ef.tar.gz
git-02a481fc6aef5d8a52f900448657d1cbe7c963ef.tar.bz2
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>
Diffstat (limited to 't/t7501-commit.sh')
-rwxr-xr-xt/t7501-commit.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh
index c2fd116..73e19c5 100755
--- a/t/t7501-commit.sh
+++ b/t/t7501-commit.sh
@@ -133,6 +133,16 @@ test_expect_success PERL \
"interactive add" \
"echo 7 | git commit --interactive | grep 'What now'"
+test_expect_success PERL \
+ "commit --interactive doesn't change index if editor aborts" \
+ "echo zoo >file &&
+ test_must_fail git diff --exit-code >diff1 &&
+ (echo u ; echo '*' ; echo q) |
+ (EDITOR=: && export EDITOR &&
+ test_must_fail git commit --interactive) &&
+ git diff >diff2 &&
+ test_cmp diff1 diff2"
+
test_expect_success \
"showing committed revisions" \
"git rev-list HEAD >current"