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