From: Varun Naik Date: Thu, 1 Aug 2019 16:09:10 +0000 (-0700) Subject: restore: add test for deleted ita files X-Git-Tag: v2.24.0-rc0~167^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=620c09e1b686e06c4ddbd5fb153f7ad898bab412;p=thirdparty%2Fgit.git 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 Signed-off-by: Varun Naik Signed-off-by: Junio C Hamano --- diff --git a/t/t2070-restore.sh b/t/t2070-restore.sh index 2650df1966..21c3f84459 100755 --- a/t/t2070-restore.sh +++ b/t/t2070-restore.sh @@ -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