summaryrefslogtreecommitdiff
path: root/src/patch_parse.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@github.com>2016-04-25 17:52:39 -0400
committerEdward Thomson <ethomson@github.com>2016-06-25 23:08:06 -0400
commit38a347ea5d9d039735d6b8e436c0c144b342aabe (patch)
tree1345460b718ca0212e9540e895af20d962a9e3f0 /src/patch_parse.c
parente774d5af764c521f3a5740f8c0f7b859ebb109c8 (diff)
downloadlibgit2-38a347ea5d9d039735d6b8e436c0c144b342aabe.tar.gz
patch::parse: handle patches with no hunks
Patches may have no hunks when there's no modifications (for example, in a rename). Handle them.
Diffstat (limited to 'src/patch_parse.c')
-rw-r--r--src/patch_parse.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/patch_parse.c b/src/patch_parse.c
index cdf48502d..72c4d148f 100644
--- a/src/patch_parse.c
+++ b/src/patch_parse.c
@@ -361,6 +361,7 @@ typedef struct {
} header_git_op;
static const header_git_op header_git_ops[] = {
+ { "diff --git ", NULL },
{ "@@ -", NULL },
{ "GIT binary patch", NULL },
{ "--- ", parse_header_git_oldpath },
@@ -437,7 +438,8 @@ static int parse_header_git(
}
if (!found) {
- error = parse_err("invalid patch header at line %d", ctx->line_num);
+ error = parse_err("invalid patch header at line %d",
+ ctx->line_num);
goto done;
}
}