test_expect_failure \
"invalid options 1" \
- "git-commit --amend -F file"
+ "git-commit -m foo -m bar -F file"
test_expect_failure \
"invalid options 2" \
"VISUAL=./editor git-commit --amend"
test_expect_failure \
- "passing --amend and -F" \
+ "passing -m and -F" \
"echo 'enough with the bongos' >file && \
- git-commit -F msg --amend ."
+ git-commit -F msg -m amending ."
test_expect_success \
"using message from other commit" \
'validate git-rev-list output.' \
'diff current expected'
+test_expect_success 'partial commit that involves removal (1)' '
+
+ git rm --cached file &&
+ mv file elif &&
+ git add elif &&
+ git commit -m "Partial: add elif" elif &&
+ git diff-tree --name-status HEAD^ HEAD >current &&
+ echo "A elif" >expected &&
+ diff expected current
+
+'
+
+test_expect_success 'partial commit that involves removal (2)' '
+
+ git commit -m "Partial: remove file" file &&
+ git diff-tree --name-status HEAD^ HEAD >current &&
+ echo "D file" >expected &&
+ diff expected current
+
+'
+
+test_expect_success 'partial commit that involves removal (3)' '
+
+ git rm --cached elif &&
+ echo elif >elif &&
+ git commit -m "Partial: modify elif" elif &&
+ git diff-tree --name-status HEAD^ HEAD >current &&
+ echo "M elif" >expected &&
+ diff expected current
+
+'
+
test_done