X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=object-refs.c;h=98ea10005a851c3879c6e65929e3e34068dc9e8b;hb=6dd36acd32476a474a5b7d2ad309a82c84513abe;hp=b0034e4b217e12b267a51301c52b75e7255aec7b;hpb=0f2ca9d5c99436d048bfe0a7161b4365a731938f;p=git.git diff --git a/object-refs.c b/object-refs.c index b0034e4b2..98ea10005 100644 --- a/object-refs.c +++ b/object-refs.c @@ -55,9 +55,13 @@ static void add_object_refs(struct object *obj, struct object_refs *ref) struct object_refs *lookup_object_refs(struct object *obj) { - int j = hash_obj(obj, refs_hash_size); struct object_refs *ref; + int j; + /* nothing to lookup */ + if (!refs_hash_size) + return NULL; + j = hash_obj(obj, refs_hash_size); while ((ref = refs_hash[j]) != NULL) { if (ref->base == obj) break; @@ -125,9 +129,6 @@ void mark_reachable(struct object *obj, unsigned int mask) if (!track_object_refs) die("cannot do reachability with object refs turned off"); - /* nothing to lookup */ - if (!refs_hash_size) - return; /* If we've been here already, don't bother */ if (obj->flags & mask) return;