restore: add test for deleted ita files
`git restore --staged` uses the same machinery as `git checkout HEAD`, so there should be a similar test case for "restore" as the existing test case for "checkout" with deleted ita files. Helped-by: Jeff King <peff@peff.net> Signed-off-by: Varun Naik <vcnaik94@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Varun Naik committed
Aug 1, 2019 at 09:09 UTC
620c09e1b686e06c4ddbd5fb153f7ad898bab412
1 file changed
+11
t/t2070-restore.sh
+11
@@ -95,4 +95,15 @@ test_expect_success 'restore --ignore-unmerged ignores unmerged entries' '
95
)
96
'
97
98
+test_expect_success 'restore --staged adds deleted intent-to-add file back to index' '
99
+ echo "nonempty" >nonempty &&
100
+ >empty &&
101
+ git add nonempty empty &&
102
+ git commit -m "create files to be deleted" &&
103
+ git rm --cached nonempty empty &&
104
+ git add -N nonempty empty &&
105
+ git restore --staged nonempty empty &&
106
+ git diff --cached --exit-code
107
+'
108
+
109
test_done