summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-07-03 17:01:22 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-07-09 23:42:22 (GMT)
commitda3ac0c14993c5e8e41875cc3ead32be71647a7a (patch)
tree051d70fc773165ff5120725910b69bbe89c7e872
parentdaba53aeaf6565b4bbdd6783c659480453ec3c5e (diff)
downloadgit-da3ac0c14993c5e8e41875cc3ead32be71647a7a.zip
git-da3ac0c14993c5e8e41875cc3ead32be71647a7a.tar.gz
git-da3ac0c14993c5e8e41875cc3ead32be71647a7a.tar.bz2
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>
-rw-r--r--builtin/apply.c2
-rwxr-xr-xt/t1512-rev-parse-disambiguation.sh2
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 fbd3658..84b8ddd 100755
--- a/t/t1512-rev-parse-disambiguation.sh
+++ b/t/t1512-rev-parse-disambiguation.sh
@@ -54,7 +54,7 @@ test_expect_success 'disambiguate tree-ish' '
git rev-parse --verify 000000000:a0blgqsjc
'
-test_expect_failure 'disambiguate blob' '
+test_expect_success 'disambiguate blob' '
sed -e "s/|$//" >patch <<-EOF &&
diff --git a/frotz b/frotz
index 000000000..ffffff 100644