Junio C Hamano [off-list ref] 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/