X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fgit.git;a=blobdiff_plain;f=merge-recursive.c;h=36948eafb750284551a3748405135a685ddba2ff;hp=d92e2acf1ed2cfb4d4ce1e50fee3a64fb70b91ac;hb=95983da6b461a4394117d4f9fcca211d7fc1403f;hpb=a397e9c236b0ff56eb15f32a2a41c852b1e5dd3b diff --git a/merge-recursive.c b/merge-recursive.c index d92e2acf1e..36948eafb7 100644 --- a/merge-recursive.c +++ b/merge-recursive.c @@ -1750,6 +1750,18 @@ static int handle_rename_rename_1to2(struct merge_options *opt, return -1; } + if (!mfi.clean && mfi.blob.mode == a->mode && + oideq(&mfi.blob.oid, &a->oid)) { + /* + * Getting here means we were attempting to merge a binary + * blob. Since we can't merge binaries, the merge algorithm + * just takes one side. But we don't want to copy the + * contents of one side to both paths; we'd rather use the + * original content at the given path for each path. + */ + oidcpy(&mfi.blob.oid, &b->oid); + mfi.blob.mode = b->mode; + } add = &ci->ren2->dst_entry->stages[flip_stage(3)]; if (is_valid(add)) { add->path = mfi.blob.path = b->path;