diff options
author | Junio C Hamano <gitster@pobox.com> | 2023-03-20 01:03:13 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-03-20 01:03:13 +0300 |
commit | a9f4a01760fae8b8ee47068120f218c983d3f215 (patch) | |
tree | 990808209a85ceacb7415567b7a04d88b1fb2941 /t | |
parent | 947604ddb7fffd6be6aa34192360ec338079dd6a (diff) | |
parent | 28d1122f9ca41a688aded33835bcb4740d1d5d8c (diff) |
Merge branch 'jk/add-p-unmerged-fix'
"git add -p" while the index is unmerged sometimes failed to parse
the diff output it internally produces and died, which has been
corrected.
* jk/add-p-unmerged-fix:
add-patch: handle "* Unmerged path" lines
Diffstat (limited to 't')
-rwxr-xr-x | t/t3701-add-interactive.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/t/t3701-add-interactive.sh b/t/t3701-add-interactive.sh index 032b61ce21..b8aaece860 100755 --- a/t/t3701-add-interactive.sh +++ b/t/t3701-add-interactive.sh @@ -1077,4 +1077,25 @@ test_expect_success 'show help from add--helper' ' test_cmp expect actual ' +test_expect_success 'reset -p with unmerged files' ' + test_when_finished "git checkout --force main" && + test_commit one conflict && + git checkout -B side HEAD^ && + test_commit two conflict && + test_must_fail git merge one && + + # this is a noop with only an unmerged entry + git reset -p && + + # add files that sort before and after unmerged entry + echo a >a && + echo z >z && + git add a z && + + # confirm that we can reset those files + printf "%s\n" y y | git reset -p && + git diff-index --cached --diff-filter=u HEAD >staged && + test_must_be_empty staged +' + test_done |