Skip to content

Commit 620c09e

Browse files
varuncnaikgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Varun Naik <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ecd7204 commit 620c09e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

t/t2070-restore.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,4 +95,15 @@ test_expect_success 'restore --ignore-unmerged ignores unmerged entries' '
9595
)
9696
'
9797

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+
98109
test_done

0 commit comments

Comments
 (0)