summaryrefslogtreecommitdiff
path: root/t/t7501-commit.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-05-16 16:47:10 -0700
committerJunio C Hamano <gitster@pobox.com>2011-05-16 16:47:10 -0700
commit7a77754cf6fde7b513da1283fe76179ffa930ecc (patch)
tree3923485c3d4f775b41c1907dca4cd9bbc4ab3c52 /t/t7501-commit.sh
parent018443526875456d335fef2dfbc78bc4de2d340d (diff)
parent02a481fc6aef5d8a52f900448657d1cbe7c963ef (diff)
downloadgit-7a77754cf6fde7b513da1283fe76179ffa930ecc.tar.gz
Merge branch 'ci/commit--interactive-atomic'
* ci/commit--interactive-atomic: Test atomic git-commit --interactive Add commit to list of config.singlekey commands Add support for -p/--patch to git-commit Allow git commit --interactive with paths t7501.8: feed a meaningful command Use a temporary index for git commit --interactive
Diffstat (limited to 't/t7501-commit.sh')
-rwxr-xr-xt/t7501-commit.sh21
1 files changed, 17 insertions, 4 deletions
diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh
index 7f7f7c7b95..3ad04363b5 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"