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
This commit is contained in:
Junio C Hamano
2011-05-16 16:47:10 -07:00
6 changed files with 75 additions and 31 deletions

View File

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