Skip to content

Commit 83b13e2

Browse files
committed
Merge branch 'jk/virtual-objects-do-exist'
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
2 parents 27cdbdd + f06ab02 commit 83b13e2

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

builtin/rev-list.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ static inline void finish_object__ma(struct object *obj)
238238
static int finish_object(struct object *obj, const char *name, void *cb_data)
239239
{
240240
struct rev_list_info *info = cb_data;
241-
if (!has_object_file(&obj->oid)) {
241+
if (oid_object_info_extended(the_repository, &obj->oid, NULL, 0) < 0) {
242242
finish_object__ma(obj);
243243
return 1;
244244
}

t/t1060-object-corruption.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,4 +127,14 @@ test_expect_success 'fetch into corrupted repo with index-pack' '
127127
)
128128
'
129129

130+
test_expect_success 'internal tree objects are not "missing"' '
131+
git init missing-empty &&
132+
(
133+
cd missing-empty &&
134+
empty_tree=$(git hash-object -t tree /dev/null) &&
135+
commit=$(echo foo | git commit-tree $empty_tree) &&
136+
git rev-list --objects $commit
137+
)
138+
'
139+
130140
test_done

0 commit comments

Comments
 (0)