Merge branch 'vn/restore-empty-ita-corner-case-fix'
"git checkout" and "git restore" to re-populate the index from a tree-ish (typically HEAD) did not work correctly for a path that was removed and then added again with the intent-to-add bit, when the corresponding working tree file was empty. This has been corrected. * vn/restore-empty-ita-corner-case-fix: restore: add test for deleted ita files checkout.c: unstage empty deleted ita files
This commit is contained in:
@ -78,4 +78,15 @@ test_expect_success 'do not touch files that are already up-to-date' '
|
||||
test_cmp expect actual
|
||||
'
|
||||
|
||||
test_expect_success 'checkout HEAD 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 checkout HEAD nonempty empty &&
|
||||
git diff --cached --exit-code
|
||||
'
|
||||
|
||||
test_done
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user