summaryrefslogtreecommitdiff
path: root/src/patch_parse.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2020-10-04 18:04:01 +0100
committerGitHub <noreply@github.com>2020-10-04 18:04:01 +0100
commita94fedc11334b23e864824ef33156a660b10022d (patch)
treebb3ef88c1ccef0bb42fc0f75e22aa5789c6530fc /src/patch_parse.c
parenta1f0135dfc9d57f88245229f40e6461f636e63b1 (diff)
parent74293ea04a21f35151f0be095baf7bd3b3fd339c (diff)
downloadlibgit2-a94fedc11334b23e864824ef33156a660b10022d.tar.gz
Merge pull request #5620 from dlax/parse-patch-add-delete-no-index
patch_parse: handle absence of "index" header for new/deleted cases
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 f65b1087d..2bf94c2cb 100644
--- a/src/patch_parse.c
+++ b/src/patch_parse.c
@@ -407,6 +407,7 @@ static const parse_header_transition transitions[] = {
{ "--- " , STATE_DIFF, STATE_PATH, parse_header_git_oldpath },
{ "--- " , STATE_INDEX, STATE_PATH, parse_header_git_oldpath },
+ { "--- " , STATE_FILEMODE, STATE_PATH, parse_header_git_oldpath },
{ "+++ " , STATE_PATH, STATE_END, parse_header_git_newpath },
{ "GIT binary patch" , STATE_INDEX, STATE_END, NULL },
{ "Binary files " , STATE_INDEX, STATE_END, NULL },