Skip to content

Commit da3ac0c

Browse files
committed
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 <[email protected]>
1 parent daba53a commit da3ac0c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

builtin/apply.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3203,7 +3203,7 @@ static void build_fake_ancestor(struct patch *list, const char *filename)
32033203
name = patch->old_name ? patch->old_name : patch->new_name;
32043204
if (0 < patch->is_new)
32053205
continue;
3206-
else if (get_sha1(patch->old_sha1_prefix, sha1))
3206+
else if (get_sha1_blob(patch->old_sha1_prefix, sha1))
32073207
/* git diff has no index line for mode/type changes */
32083208
if (!patch->lines_added && !patch->lines_deleted) {
32093209
if (get_current_sha1(patch->old_name, sha1))

t/t1512-rev-parse-disambiguation.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ test_expect_success 'disambiguate tree-ish' '
5454
git rev-parse --verify 000000000:a0blgqsjc
5555
'
5656

57-
test_expect_failure 'disambiguate blob' '
57+
test_expect_success 'disambiguate blob' '
5858
sed -e "s/|$//" >patch <<-EOF &&
5959
diff --git a/frotz b/frotz
6060
index 000000000..ffffff 100644

0 commit comments

Comments
 (0)