Browse Source

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>
maint
Conrad Irwin 14 years ago committed by Junio C Hamano
parent
commit
02a481fc6a
  1. 10
      t/t7501-commit.sh

10
t/t7501-commit.sh

@ -133,6 +133,16 @@ test_expect_success PERL \ @@ -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"

Loading…
Cancel
Save