From: Junio C Hamano Date: Tue, 03 Jul 2012 21:37:11 GMT Subject: [PATCH v5 21/25] apply: --build-fake-ancestor expects blobs Message-ID: <1341351435-31011-22-git-send-email-gitster@pobox.com> In-Reply-To: <1341351435-31011-1-git-send-email-gitster@pobox.com> 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 --- builtin/apply.c | 2 +- t/t1512-rev-parse-disambiguation.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/apply.c b/builtin/apply.c index c24dc54..8b2db1d 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -3203,7 +3203,7 @@ static void build_fake_ancestor(struct patch *list, const char *filename) name = patch->old_name ? patch->old_name : patch->new_name; if (0 < patch->is_new) continue; - else if (get_sha1(patch->old_sha1_prefix, sha1)) + else if (get_sha1_blob(patch->old_sha1_prefix, sha1)) /* git diff has no index line for mode/type changes */ if (!patch->lines_added && !patch->lines_deleted) { if (get_current_sha1(patch->old_name, sha1)) diff --git a/t/t1512-rev-parse-disambiguation.sh b/t/t1512-rev-parse-disambiguation.sh index 4851a5f..87270c9 100755 --- a/t/t1512-rev-parse-disambiguation.sh +++ b/t/t1512-rev-parse-disambiguation.sh @@ -53,7 +53,7 @@ test_expect_success 'disambiguate tree-ish' ' git rev-parse --verify 11021982:bz01t33 ' -test_expect_failure 'disambiguate blob' ' +test_expect_success 'disambiguate blob' ' sed -e "s/|$//" >patch <<-EOF && diff --git a/frotz b/frotz index 11021982..11021982 100644 -- 1.7.11.1.229.g706c98f