Avoid excessive rewrites in merge-recursive
If a file is changed in one branch, and renamed and changed to the same content in another branch than we can skip the rewrite of this file in the working directory, as the content does not change. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
parent
6169a89c4f
commit
c135ee88f8
@ -1342,6 +1342,11 @@ static int process_renames(struct path_list *a_renames,
|
|||||||
mfi = merge_file(o, a, b,
|
mfi = merge_file(o, a, b,
|
||||||
a_branch, b_branch);
|
a_branch, b_branch);
|
||||||
|
|
||||||
|
if (mfi.merge && mfi.clean &&
|
||||||
|
sha_eq(mfi.sha, ren1->pair->two->sha1) &&
|
||||||
|
mfi.mode == ren1->pair->two->mode)
|
||||||
|
output(3, "Skipped %s (merged same as existing)", ren1_dst);
|
||||||
|
else {
|
||||||
if (mfi.merge || !mfi.clean)
|
if (mfi.merge || !mfi.clean)
|
||||||
output(1, "Renamed %s => %s", ren1_src, ren1_dst);
|
output(1, "Renamed %s => %s", ren1_src, ren1_dst);
|
||||||
if (mfi.merge)
|
if (mfi.merge)
|
||||||
@ -1359,6 +1364,7 @@ static int process_renames(struct path_list *a_renames,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
path_list_clear(&a_by_dst, 0);
|
path_list_clear(&a_by_dst, 0);
|
||||||
path_list_clear(&b_by_dst, 0);
|
path_list_clear(&b_by_dst, 0);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user