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>
This commit is contained in:
parent
ecd72042de
commit
620c09e1b6
@ -95,4 +95,15 @@ test_expect_success 'restore --ignore-unmerged ignores unmerged entries' '
|
|||||||
)
|
)
|
||||||
'
|
'
|
||||||
|
|
||||||
|
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
|
test_done
|
||||||
|
Loading…
Reference in New Issue
Block a user