apply: --build-fake-ancestor expects blobs

The "index" line read from the patch to reconstruct a partial preimage tree records the object names of blob objects. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Jul 3, 2012 at 10:01 UTC da3ac0c14993c5e8e41875cc3ead32be71647a7a
2 files changed +2 -2
builtin/apply.c
+1 -1
@@ -3203,7 +3203,7 @@ static void build_fake_ancestor(struct patch *list, const char *filename)
3203 name = patch->old_name ? patch->old_name : patch->new_name;
3204 if (0 < patch->is_new)
3205 continue;
3206 - else if (get_sha1(patch->old_sha1_prefix, sha1))
3206 + else if (get_sha1_blob(patch->old_sha1_prefix, sha1))
3207 /* git diff has no index line for mode/type changes */
3208 if (!patch->lines_added && !patch->lines_deleted) {
3209 if (get_current_sha1(patch->old_name, sha1))
t/t1512-rev-parse-disambiguation.sh
+1 -1
@@ -54,7 +54,7 @@ test_expect_success 'disambiguate tree-ish' '
54 git rev-parse --verify 000000000:a0blgqsjc
55 '
56
57 -test_expect_failure 'disambiguate blob' '
57 +test_expect_success 'disambiguate blob' '
58 sed -e "s/|$//" >patch <<-EOF &&
59 diff --git a/frotz b/frotz
60 index 000000000..ffffff 100644