X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=t%2Ft7501-commit.sh;h=3ad04363b5920497617f806a18a3a5a0083ac1b9;hb=8f41c07f90da5e314cbc428f1e3e936563f7f39d;hp=7f7f7c7b95475b3b0673de00b68914a08098aead;hpb=c72b9143f90f839fdfe34ea252e84cb43be71d95;p=git.git diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh index 7f7f7c7b9..3ad04363b 100755 --- a/t/t7501-commit.sh +++ b/t/t7501-commit.sh @@ -42,10 +42,13 @@ test_expect_success \ "echo King of the bongo >file && test_must_fail git commit -m foo -a file" -test_expect_success PERL \ - "using paths with --interactive" \ - "echo bong-o-bong >file && - ! (echo 7 | git commit -m foo --interactive file)" +test_expect_success PERL 'can use paths with --interactive' ' + echo bong-o-bong >file && + # 2: update, 1:st path, that is all, 7: quit + ( echo 2; echo 1; echo; echo 7 ) | + git commit -m foo --interactive file && + git reset --hard HEAD^ +' test_expect_success \ "using invalid commit with -C" \ @@ -131,6 +134,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"