Make GIT_INDEX_FILE apply to git-commit
[gitweb.git] / t / t7501-commit.sh
index 6bd3c9e3e0e1f4433a0b71dc8b930c77736e460d..b151b51a3420fdba921da16979ec4a480b61a973 100644 (file)
@@ -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