summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6169a89)
raw | patch | inline | side by side (parent: 6169a89)
author | Alex Riesen <raa.lkml@gmail.com> | |
Wed, 25 Apr 2007 20:06:59 +0000 (22:06 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Thu, 26 Apr 2007 06:43:16 +0000 (23:43 -0700) |
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>
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>
merge-recursive.c | patch | blob | history |
diff --git a/merge-recursive.c b/merge-recursive.c
index 403a4c8bca3062c8fa586e369b3fd1308c919641..37f1ba93fe943e45a984c012b31390d68fc9498c 100644 (file)
--- a/merge-recursive.c
+++ b/merge-recursive.c
mfi = merge_file(o, a, b,
a_branch, b_branch);
- if (mfi.merge || !mfi.clean)
- output(1, "Renamed %s => %s", ren1_src, ren1_dst);
- if (mfi.merge)
- output(2, "Auto-merged %s", ren1_dst);
- if (!mfi.clean) {
- output(1, "CONFLICT (rename/modify): Merge conflict in %s",
- ren1_dst);
- clean_merge = 0;
-
- if (!index_only)
- update_stages(ren1_dst,
- o, a, b, 1);
+ 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)
+ output(1, "Renamed %s => %s", ren1_src, ren1_dst);
+ if (mfi.merge)
+ output(2, "Auto-merged %s", ren1_dst);
+ if (!mfi.clean) {
+ output(1, "CONFLICT (rename/modify): Merge conflict in %s",
+ ren1_dst);
+ clean_merge = 0;
+
+ if (!index_only)
+ update_stages(ren1_dst,
+ o, a, b, 1);
+ }
+ update_file(mfi.clean, mfi.sha, mfi.mode, ren1_dst);
}
- update_file(mfi.clean, mfi.sha, mfi.mode, ren1_dst);
}
}
}