Re: Odd behavior with git and cairo-devel repo

From: Andre Noll <maan@systemlinux.org>
Date: 2006-06-21 12:46:05
On 20:00, Art Haas wrote:

> $ 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

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Received on Wed Jun 21 12:47:12 2006

This archive was generated by hypermail 2.1.8 : 2006-06-21 12:47:34 EST