aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-09-14 18:23:01 -0700
committerJunio C Hamano <gitster@pobox.com>2007-09-14 18:23:01 -0700
commit04222b245c5e0d49242ef1ca995fadd5fa082cd3 (patch)
treed5206956b63447b10781bb899597f0f38c632a8b /t
parentf6336167e9f233d3a68c8ded18b172ba50cde743 (diff)
parenta7a0f3d3f858eef1f1326821343c640c5b3838ce (diff)
downloadgit-04222b245c5e0d49242ef1ca995fadd5fa082cd3.tar.gz
git-04222b245c5e0d49242ef1ca995fadd5fa082cd3.tar.xz
Merge branch 'jc/partial-remove'
* jc/partial-remove: Document ls-files --with-tree=<tree-ish> git-commit: partial commit of paths only removed from the index git-commit: Allow partial commit of file removal.
Diffstat (limited to 't')
-rw-r--r--t/t7501-commit.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh
index 6bd3c9e3e..b151b51a3 100644
--- a/t/t7501-commit.sh
+++ b/t/t7501-commit.sh
@@ -131,4 +131,36 @@ test_expect_success \
'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