Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'range-diff.c')
-rw-r--r--range-diff.c7
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