aboutsummaryrefslogtreecommitdiffstats
path: root/add-patch.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-03-19 15:03:13 -0700
committerJunio C Hamano <gitster@pobox.com>2023-03-19 15:03:13 -0700
commita9f4a01760fae8b8ee47068120f218c983d3f215 (patch)
tree990808209a85ceacb7415567b7a04d88b1fb2941 /add-patch.c
parentMerge branch 'ew/fetch-no-write-fetch-head-fix' (diff)
parentadd-patch: handle "* Unmerged path" lines (diff)
downloadgit-a9f4a01760fae8b8ee47068120f218c983d3f215.tar.gz
git-a9f4a01760fae8b8ee47068120f218c983d3f215.zip
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 'add-patch.c')
-rw-r--r--add-patch.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/add-patch.c b/add-patch.c
index c6e451c136..e6c34b9c38 100644
--- a/add-patch.c
+++ b/add-patch.c
@@ -484,7 +484,8 @@ static int parse_diff(struct add_p_state *s, const struct pathspec *ps)
if (!eol)
eol = pend;
- if (starts_with(p, "diff ")) {
+ if (starts_with(p, "diff ") ||
+ starts_with(p, "* Unmerged path ")) {
complete_file(marker, hunk);
ALLOC_GROW_BY(s->file_diff, s->file_diff_nr, 1,
file_diff_alloc);