Re: [PATCH 6/8] apply: fall back on three-way merge
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- May 10, 2012, 07:26 UTC
- Message-ID
- <vpqy5p0bioh.fsf@bauges.imag.fr>
- In-Reply-To
- <1336629745-22436-7-git-send-email-gitster@pobox.com>
Junio C Hamano <gitster@pobox.com> writes:
> + /* Preimage the patch was prepared for */
> + if (get_sha1(patch->old_sha1_prefix, pre_sha1) ||
> + read_blob_object(&buf, pre_sha1, patch->old_mode))
> + return error("repository lacks necessary blobs to fall back on 3-way merge.");What happens if there are multiple objects for the same pre_sha1? It's just 7 characters, so conflicts are unlikely but possible. Ideally, we could try applying the patch to all the blobs having the same prefix sha1, and take the first one for which the patch applies cleanly.
-- Matthieu Moy http://www-verimag.imag.fr/~moy/