Skip to content

patch_parse: handle patches without extended headers#5273

Merged
pks-t merged 1 commit intolibgit2:masterfrom
dlax:parse-diff-without-extended-headers
Oct 17, 2019
Merged

patch_parse: handle patches without extended headers#5273
pks-t merged 1 commit intolibgit2:masterfrom
dlax:parse-diff-without-extended-headers

Conversation

@dlax
Copy link
Contributor

@dlax dlax commented Oct 17, 2019

Extended header lines (especially the "index .. ") are
not required by "git apply" so it import patches. So we allow the
from-file/to-file lines (--- a/file\n+++ b/file) to directly follow the
git diff header.

This fixes #5267.

Extended header lines (especially the "index <hash>..<hash> <mode>") are
not required by "git apply" so it import patches. So we allow the
from-file/to-file lines (--- a/file\n+++ b/file) to directly follow the
git diff header.

This fixes libgit2#5267.
Copy link
Member

@pks-t pks-t left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, thanks a lot for your pull request and the lovely test!

@pks-t pks-t merged commit c9464bf into libgit2:master Oct 17, 2019
@ddevault
Copy link
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

libgit2's patch parser could ignore missing `index [:hexdigit:]+..[:hexdigit:]+ lines

3 participants