From: Junio C Hamano Date: Sat, 15 Sep 2012 04:39:56 +0000 (-0700) Subject: Merge branch 'jc/ll-merge-binary-ours' X-Git-Tag: v1.8.0-rc0~49 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e6d29a4b47cf476e18658609033bdee4c42db3b8;p=git.git Merge branch 'jc/ll-merge-binary-ours' "git merge -Xtheirs" did not help content-level merge of binary files; it should just take their version. Also "*.jpg binary" in the attributes did not imply they should use the binary ll-merge driver. * jc/ll-merge-binary-ours: ll-merge: warn about inability to merge binary files only when we can't attr: "binary" attribute should choose built-in "binary" merge driver merge: teach -Xours/-Xtheirs to binary ll-merge driver --- e6d29a4b47cf476e18658609033bdee4c42db3b8 diff --cc ll-merge.c index f3f769215,307315b78..acea33bf1 --- a/ll-merge.c +++ b/ll-merge.c @@@ -46,11 -46,24 +46,24 @@@ static int ll_binary_merge(const struc assert(opts); /* - * The tentative merge result is "ours" for the final round, - * or common ancestor for an internal merge. Still return - * "conflicted merge" status. + * The tentative merge result is the or common ancestor for an internal merge. */ - stolen = opts->virtual_ancestor ? orig : src1; + if (opts->virtual_ancestor) { + stolen = orig; + } else { + switch (opts->variant) { + default: - warning("Cannot merge binary files: %s (%s vs. %s)\n", ++ warning("Cannot merge binary files: %s (%s vs. %s)", + path, name1, name2); + /* fallthru */ + case XDL_MERGE_FAVOR_OURS: + stolen = src1; + break; + case XDL_MERGE_FAVOR_THEIRS: + stolen = src2; + break; + } + } result->ptr = stolen->ptr; result->size = stolen->size;