Skip to content

Commit

Permalink
apply: --build-fake-ancestor expects blobs
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Jul 9, 2012
1 parent daba53a commit da3ac0c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion builtin/apply.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion t/t1512-rev-parse-disambiguation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit da3ac0c

Please sign in to comment.