summaryrefslogtreecommitdiff
path: root/src/patch_parse.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2017-09-01 09:37:05 +0200
committerPatrick Steinhardt <ps@pks.im>2017-09-01 09:41:12 +0200
commitcc4c44a98a552b64c281101cbadb91effa5be5dd (patch)
tree9247fafb740fcc4920f5bf1b1e6838ebb04c85bb /src/patch_parse.c
parent57bc9daba35dcabdacc40fd8bab0577fa7e86367 (diff)
downloadlibgit2-cc4c44a98a552b64c281101cbadb91effa5be5dd.tar.gz
patch_parse: fix parsing patches only containing exact renames
Patches which contain exact renames only will not contain an actual diff body, but only a list of files that were renamed. Thus, the patch header is immediately followed by the terminating sequence "-- ". We currently do not recognize this character sequence as a possible terminating sequence. Add it and create a test to catch the failure.
Diffstat (limited to 'src/patch_parse.c')
-rw-r--r--src/patch_parse.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/patch_parse.c b/src/patch_parse.c
index 2f0b2570d..fad892d8a 100644
--- a/src/patch_parse.c
+++ b/src/patch_parse.c
@@ -439,6 +439,7 @@ static const parse_header_transition transitions[] = {
/* Next patch */
{ "diff --git " , STATE_END, 0, NULL },
{ "@@ -" , STATE_END, 0, NULL },
+ { "-- " , STATE_END, 0, NULL },
};
static int parse_header_git(