summaryrefslogtreecommitdiff
path: root/t/t2070-restore.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2019-08-22 12:34:11 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-08-22 12:34:11 -0700
commit072735ea58407db41c0874fd2f8a91d0c191d49b (patch)
tree1179894f8b5414c88bf7874a4510a702b36e8b2d /t/t2070-restore.sh
parentMerge branch 'sc/pack-refs-deletion-racefix' (diff)
parentrestore: add test for deleted ita files (diff)
downloadtgif-072735ea58407db41c0874fd2f8a91d0c191d49b.tar.xz
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
Diffstat (limited to 't/t2070-restore.sh')
-rwxr-xr-xt/t2070-restore.sh11
1 files changed, 11 insertions, 0 deletions
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