summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDenis Laxalde <denis@laxalde.org>2019-09-28 15:52:25 +0200
committerDenis Laxalde <denis@laxalde.org>2019-09-28 15:52:25 +0200
commitb61810bf1ff1007bc0a5d8e47362a735f2ff1f0b (patch)
tree76ebb13fba7ad245f68d08ce0bd0c78a84c8f4c4 /src
parent70325370667370159d5b85690c6dd5db17be3b20 (diff)
downloadlibgit2-b61810bf1ff1007bc0a5d8e47362a735f2ff1f0b.tar.gz
patch_parse: handle patches with new empty files
Patches containing additions of empty files will not contain diff data but will end with the index header line followed by the terminating sequence "-- ". We follow the same logic as in cc4c44a and allow "-- " to immediately follow the index header.
Diffstat (limited to 'src')
-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 84953ee14..51c4bb200 100644
--- a/src/patch_parse.c
+++ b/src/patch_parse.c
@@ -406,6 +406,7 @@ static const parse_header_transition transitions[] = {
/* Next patch */
{ "diff --git " , STATE_END, 0, NULL },
{ "@@ -" , STATE_END, 0, NULL },
+ { "-- " , STATE_INDEX, 0, NULL },
{ "-- " , STATE_END, 0, NULL },
};