From: Junio C Hamano Date: Wed, 17 Oct 2012 17:26:51 +0000 (-0700) Subject: Merge branch 'jc/ll-merge-binary-ours' into maint X-Git-Tag: v1.7.12.4~10 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8c4bcd34bd194d7932a153f464cbc6ada7b27b46;p=git.git Merge branch 'jc/ll-merge-binary-ours' into maint * 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 --- 8c4bcd34bd194d7932a153f464cbc6ada7b27b46 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;