aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-09-14 16:53:58 -0700
committerJunio C Hamano <gitster@pobox.com>2007-09-14 16:53:58 -0700
commitdb33af0a7f64ffc48de3ad018a1df03f744fb7a2 (patch)
tree52a18bd2f7cfb709c8dfec9a50d0f5f863b252c8 /t
parent80bffaf7fbe09ef62ecb9a6ffea70ac0171b456c (diff)
downloadgit-db33af0a7f64ffc48de3ad018a1df03f744fb7a2.tar.gz
git-db33af0a7f64ffc48de3ad018a1df03f744fb7a2.tar.xz
git-commit: partial commit of paths only removed from the index
Because a partial commit is meant to be a way to ignore what are staged in the index, "git rm --cached A && git commit A" should just record what is in A on the filesystem. The previous patch made the command sequence to barf, saying that A has not been added yet. This fixes it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rw-r--r--t/t7501-commit.sh15
1 files changed, 13 insertions, 2 deletions
diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh
index f178f5620..b151b51a3 100644
--- a/t/t7501-commit.sh
+++ b/t/t7501-commit.sh
@@ -131,7 +131,7 @@ test_expect_success \
'validate git-rev-list output.' \
'diff current expected'
-test_expect_success 'partial commit that involve removal (1)' '
+test_expect_success 'partial commit that involves removal (1)' '
git rm --cached file &&
mv file elif &&
@@ -143,7 +143,7 @@ test_expect_success 'partial commit that involve removal (1)' '
'
-test_expect_success 'partial commit that involve removal (2)' '
+test_expect_success 'partial commit that involves removal (2)' '
git commit -m "Partial: remove file" file &&
git diff-tree --name-status HEAD^ HEAD >current &&
@@ -152,4 +152,15 @@ test_expect_success 'partial commit that involve removal (2)' '
'
+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