diff options
Diffstat (limited to 'range-diff.c')
-rw-r--r-- | range-diff.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/range-diff.c b/range-diff.c index 784fac301b..a5202d8b6c 100644 --- a/range-diff.c +++ b/range-diff.c @@ -119,9 +119,10 @@ static int read_patches(const char *range, struct string_list *list) strbuf_addch(&buf, '\n'); } continue; - } else if (starts_with(line, "@@ ")) - strbuf_addstr(&buf, "@@"); - else if (!line[0] || starts_with(line, "index ")) + } else if (skip_prefix(line, "@@ ", &p)) { + p = strstr(p, "@@"); + strbuf_addstr(&buf, p ? p : "@@"); + } else if (!line[0] || starts_with(line, "index ")) /* * A completely blank (not ' \n', which is context) * line is not valid in a diff. We skip it |