Fourth batch
[gitweb.git] / t / t2022-checkout-paths.sh
index e74d58b9e198a4ea2195d3fc6906e651a0a1d650..6844afafc0eb926713e73c1042874155d18c08bc 100755 (executable)
@@ -73,9 +73,20 @@ test_expect_success 'do not touch files that are already up-to-date' '
        git checkout HEAD -- file1 file2 &&
        echo one >expect &&
        test_cmp expect file1 &&
-       echo "1000000000        file2" >expect &&
-       test-tool chmtime -v +0 file2 >actual &&
+       echo "1000000000" >expect &&
+       test-tool chmtime --get file2 >actual &&
        test_cmp expect actual
 '
 
+test_expect_success 'checkout HEAD adds deleted intent-to-add file back to index' '
+       echo "nonempty" >nonempty &&
+       >empty &&
+       git add nonempty empty &&
+       git commit -m "create files to be deleted" &&
+       git rm --cached nonempty empty &&
+       git add -N nonempty empty &&
+       git checkout HEAD nonempty empty &&
+       git diff --cached --exit-code
+'
+
 test_done