summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: beeeb45)
raw | patch | inline | side by side (parent: beeeb45)
author | Jonathan Nieder <jrnieder@gmail.com> | |
Thu, 5 Aug 2010 11:13:49 +0000 (06:13 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 6 Aug 2010 16:20:00 +0000 (09:20 -0700) |
The merge machinery decides whether to resmudge and clean relevant
entries based on the global merge_renormalize setting, which is set by
"git merge" based on its configuration (and left alone by other
commands).
A nicer interface would make that decision a parameter to merge_trees
so callers would pass in a choice made on a call-by-call basis.
Start by making blob_unchanged stop examining the merge_renormalize
global.
In other words, this change is a trivial no-op, but it brings us
closer to something good.
Cc: Eyvind Bernhardsen <eyvind.bernhardsen@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
entries based on the global merge_renormalize setting, which is set by
"git merge" based on its configuration (and left alone by other
commands).
A nicer interface would make that decision a parameter to merge_trees
so callers would pass in a choice made on a call-by-call basis.
Start by making blob_unchanged stop examining the merge_renormalize
global.
In other words, this change is a trivial no-op, but it brings us
closer to something good.
Cc: Eyvind Bernhardsen <eyvind.bernhardsen@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
merge-recursive.c | patch | blob | history |
diff --git a/merge-recursive.c b/merge-recursive.c
index 5ad8fc9e7ea7c6653e28343ccc0fa0c260e3affd..2b55fc27dd3739cc92c3435f811f37af8081fbe7 100644 (file)
--- a/merge-recursive.c
+++ b/merge-recursive.c
static int blob_unchanged(const unsigned char *o_sha,
const unsigned char *a_sha,
- const char *path)
+ int renormalize, const char *path)
{
struct strbuf o = STRBUF_INIT;
struct strbuf a = STRBUF_INIT;
if (sha_eq(o_sha, a_sha))
return 1;
- if (!merge_renormalize)
+ if (!renormalize)
return 0;
assert(o_sha && a_sha);
print_index_entry("\tpath: ", entry);
*/
int clean_merge = 1;
+ int normalize = merge_renormalize;
unsigned o_mode = entry->stages[1].mode;
unsigned a_mode = entry->stages[2].mode;
unsigned b_mode = entry->stages[3].mode;
if (o_sha && (!a_sha || !b_sha)) {
/* Case A: Deleted in one */
if ((!a_sha && !b_sha) ||
- (!b_sha && blob_unchanged(o_sha, a_sha, path)) ||
- (!a_sha && blob_unchanged(o_sha, b_sha, path))) {
+ (!b_sha && blob_unchanged(o_sha, a_sha, normalize, path)) ||
+ (!a_sha && blob_unchanged(o_sha, b_sha, normalize, path))) {
/* Deleted in both or deleted in one and
* unchanged in the other */
if (a_sha)