Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/patch_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -1025,13 +1025,17 @@ static int check_filenames(git_patch_parsed *patch)
/* Prefer the rename filenames as they are unambiguous and unprefixed */
if (patch->rename_old_path)
patch->base.delta->old_file.path = patch->rename_old_path;
else
else if (prefixed_old)
patch->base.delta->old_file.path = prefixed_old + old_prefixlen;
else
patch->base.delta->old_file.path = NULL;

if (patch->rename_new_path)
patch->base.delta->new_file.path = patch->rename_new_path;
else
else if (prefixed_new)
patch->base.delta->new_file.path = prefixed_new + new_prefixlen;
else
patch->base.delta->new_file.path = NULL;

if (!patch->base.delta->old_file.path &&
!patch->base.delta->new_file.path)
Expand Down