Skip to content

Commit

Permalink
Test atomic git-commit --interactive
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Conrad Irwin authored and Junio C Hamano committed May 10, 2011
1 parent e6b57a8 commit 02a481f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions t/t7501-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 02a481f

Please sign in to comment.