diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-06-09 04:06:31 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-06-09 04:06:31 +0300 |
commit | 2bdf00e66ae501c417fa33f887f2c60ef8719b2a (patch) | |
tree | 3d8317453d8e899a3ea025f541f0f86a371529a0 /t | |
parent | b37fd14beb39b9f545bd72e42e1bdbb00bad4b3d (diff) | |
parent | 2c8bd8471a6abc68064dafc743362547fc730f77 (diff) |
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 && |