diff-delta: set size out-parameter to 0 for NULL delta
[gitweb.git] / t / t2070-restore.sh
index 73ea13ede91c03e87e7af2a37f45032669ecda7b..21c3f84459dfe29053bbb0d9a43160a6df33f737 100755 (executable)
@@ -90,10 +90,20 @@ test_expect_success 'restore --ignore-unmerged ignores unmerged entries' '
 
                git restore --ignore-unmerged --quiet . >output 2>&1 &&
                git diff common >diff-output &&
-               : >empty &&
-               test_cmp empty output &&
-               test_cmp empty diff-output
+               test_must_be_empty output &&
+               test_must_be_empty diff-output
        )
 '
 
+test_expect_success 'restore --staged 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 restore --staged nonempty empty &&
+       git diff --cached --exit-code
+'
+
 test_done