mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-11 04:28:26 +00:00
patch::parse: handle patches with no hunks
Patches may have no hunks when there's no modifications (for example, in a rename). Handle them.
This commit is contained in:
parent
e774d5af76
commit
38a347ea5d
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user