Skip to content

Commit

Permalink
Merge branch 'jk/virtual-objects-do-exist'
Browse files Browse the repository at this point in the history
A recent update broke "is this object available to us?" check for
well-known objects like an empty tree (which should yield "yes",
even when there is no on-disk object for an empty tree), which has
been corrected.

* jk/virtual-objects-do-exist:
  rev-list: allow cached objects in existence check
  • Loading branch information
gitster committed Mar 20, 2019
2 parents 27cdbdd + f06ab02 commit 83b13e2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion builtin/rev-list.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ static inline void finish_object__ma(struct object *obj)
static int finish_object(struct object *obj, const char *name, void *cb_data)
{
struct rev_list_info *info = cb_data;
if (!has_object_file(&obj->oid)) {
if (oid_object_info_extended(the_repository, &obj->oid, NULL, 0) < 0) {
finish_object__ma(obj);
return 1;
}
Expand Down
10 changes: 10 additions & 0 deletions t/t1060-object-corruption.sh
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,14 @@ test_expect_success 'fetch into corrupted repo with index-pack' '
)
'

test_expect_success 'internal tree objects are not "missing"' '
git init missing-empty &&
(
cd missing-empty &&
empty_tree=$(git hash-object -t tree /dev/null) &&
commit=$(echo foo | git commit-tree $empty_tree) &&
git rev-list --objects $commit
)
'

test_done

0 comments on commit 83b13e2

Please sign in to comment.