Commit c79f9dae by Patrick Steinhardt

patch_parse: improve formatting

parent 1df7d27a
......@@ -921,21 +921,15 @@ static int check_filenames(git_patch_parsed *patch)
return git_parse_err("missing old path");
/* Ensure (non-renamed) paths match */
if (check_header_names(
patch->header_old_path, patch->old_path, "old", added) < 0 ||
check_header_names(
patch->header_new_path, patch->new_path, "new", deleted) < 0)
if (check_header_names(patch->header_old_path, patch->old_path, "old", added) < 0 ||
check_header_names(patch->header_new_path, patch->new_path, "new", deleted) < 0)
return -1;
prefixed_old = (!added && patch->old_path) ? patch->old_path :
patch->header_old_path;
prefixed_new = (!deleted && patch->new_path) ? patch->new_path :
patch->header_new_path;
prefixed_old = (!added && patch->old_path) ? patch->old_path : patch->header_old_path;
prefixed_new = (!deleted && patch->new_path) ? patch->new_path : patch->header_new_path;
if (check_prefix(
&patch->old_prefix, &old_prefixlen, patch, prefixed_old) < 0 ||
check_prefix(
&patch->new_prefix, &new_prefixlen, patch, prefixed_new) < 0)
if (check_prefix(&patch->old_prefix, &old_prefixlen, patch, prefixed_old) < 0 ||
check_prefix(&patch->new_prefix, &new_prefixlen, patch, prefixed_new) < 0)
return -1;
/* Prefer the rename filenames as they are unambiguous and unprefixed */
......
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