Re: Odd behavior with git and cairo-devel repo
- From
- Andre Noll <maan@systemlinux.org>
- Date
- Jun 21, 2006, 02:46 UTC
- Message-ID
- <20060621024605.GO11245@skl-net.de>
- In-Reply-To
- <20060621010030.GP2820@artsapartment.org>
On 20:00, Art Haas wrote:
Show 5 quoted lines
> $ git clone git://git.cairographics.org/git/cairo cairo > [ ... git clones the repo without problem ... ] > $ cd cairo > $ git fsck-objects > Floating point exception
This is due to refs_hash_size being zero in mark_reachable(). Both "git fsck-objects --full" and "git repack -a -d" seem to work fine with the patch below (tested by cloning your repo).
--- Currently, we don't check refs_hash_size size and happily call lookup_object_refs() even if refs_hash_size is zero which leads to a division by zero in hash_obj().
Signed-off-by: Andre Noll <maan@systemlinux.org> ---
diff --git a/object-refs.c b/object-refs.c index 8afa227..a7d49c6 100644 --- a/object-refs.c +++ b/object-refs.c @@ -127,6 +127,9 @@ void mark_reachable(struct object *obj, 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;
-- The only person who always got his work done by Friday was Robinson Crusoe