mirror of
https://git.proxmox.com/git/libgit2
synced 2025-06-23 21:38:19 +00:00
patch_parse: don't set new mode when deleted
This commit is contained in:
parent
28f704433b
commit
d536ceacf5
@ -881,10 +881,10 @@ static int check_patch(git_patch_parsed *patch)
|
|||||||
patch->base.delta->status != GIT_DELTA_DELETED)
|
patch->base.delta->status != GIT_DELTA_DELETED)
|
||||||
return parse_err("missing new file path");
|
return parse_err("missing new file path");
|
||||||
|
|
||||||
if (patch->base.delta->old_file.path && patch->base.delta->new_file.path) {
|
if (patch->base.delta->old_file.path &&
|
||||||
if (!patch->base.delta->new_file.mode)
|
patch->base.delta->status != GIT_DELTA_DELETED &&
|
||||||
patch->base.delta->new_file.mode = patch->base.delta->old_file.mode;
|
!patch->base.delta->new_file.mode)
|
||||||
}
|
patch->base.delta->new_file.mode = patch->base.delta->old_file.mode;
|
||||||
|
|
||||||
if (patch->base.delta->status == GIT_DELTA_MODIFIED &&
|
if (patch->base.delta->status == GIT_DELTA_MODIFIED &&
|
||||||
!(patch->base.delta->flags & GIT_DIFF_FLAG_BINARY) &&
|
!(patch->base.delta->flags & GIT_DIFF_FLAG_BINARY) &&
|
||||||
|
Loading…
Reference in New Issue
Block a user