X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=object.c;h=1577f74281be776082fecebdf8947bcb8c7c6802;hb=3904848c6ea8815236db66956f6a7d77e13fb384;hp=427e14cae2deb42138a439f7b2d69d3e06bb9417;hpb=069b20a198f171512a1d2d2163b40f70c94f5257;p=git.git diff --git a/object.c b/object.c index 427e14ca..1577f742 100644 --- a/object.c +++ b/object.c @@ -1,8 +1,8 @@ +#include "cache.h" #include "object.h" #include "blob.h" #include "tree.h" #include "commit.h" -#include "cache.h" #include "tag.h" struct object **objs; @@ -82,7 +82,12 @@ static int compare_object_pointers(const void *a, const void *b) { const struct object * const *pa = a; const struct object * const *pb = b; - return *pa - *pb; + if (*pa == *pb) + return 0; + else if (*pa < *pb) + return -1; + else + return 1; } void set_object_refs(struct object *obj, struct object_refs *refs)