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>
This commit is contained in:
Conrad Irwin 2011-05-10 12:12:31 -07:00 committed by Junio C Hamano
parent e6b57a8a4e
commit 02a481fc6a

View File

@ -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"