Commit d536ceac by Edward Thomson Committed by Edward Thomson

patch_parse: don't set new mode when deleted

parent 28f70443
......@@ -881,10 +881,10 @@ static int check_patch(git_patch_parsed *patch)
patch->base.delta->status != GIT_DELTA_DELETED)
return parse_err("missing new file path");
if (patch->base.delta->old_file.path && patch->base.delta->new_file.path) {
if (!patch->base.delta->new_file.mode)
if (patch->base.delta->old_file.path &&
patch->base.delta->status != GIT_DELTA_DELETED &&
!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 &&
!(patch->base.delta->flags & GIT_DIFF_FLAG_BINARY) &&
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment