diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-06-08 18:06:31 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-06-08 18:06:31 -0700 |
commit | 2bdf00e66ae501c417fa33f887f2c60ef8719b2a (patch) | |
tree | 3d8317453d8e899a3ea025f541f0f86a371529a0 /t | |
parent | Merge branch 'dl/remote-curl-deadlock-fix' (diff) | |
parent | checkout -p: handle new files correctly (diff) | |
download | tgif-2bdf00e66ae501c417fa33f887f2c60ef8719b2a.tar.xz |
Merge branch 'js/checkout-p-new-file'
"git checkout -p" did not handle a newly added path at all.
* js/checkout-p-new-file:
checkout -p: handle new files correctly
Diffstat (limited to 't')
-rwxr-xr-x | t/t3701-add-interactive.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/t/t3701-add-interactive.sh b/t/t3701-add-interactive.sh index b3d8bb7577..49decbac71 100755 --- a/t/t3701-add-interactive.sh +++ b/t/t3701-add-interactive.sh @@ -412,6 +412,25 @@ test_expect_success 'deleting an empty file' ' diff_cmp expected diff ' +test_expect_success 'adding an empty file' ' + git init added && + ( + cd added && + test_commit initial && + >empty && + git add empty && + test_tick && + git commit -m empty && + git tag added-file && + git reset --hard HEAD^ && + test_path_is_missing empty && + + echo y | git checkout -p added-file -- >actual && + test_path_is_file empty && + test_i18ngrep "Apply addition to index and worktree" actual + ) +' + test_expect_success 'split hunk setup' ' git reset --hard && test_write_lines 10 20 30 40 50 60 >test && |