]> git.ipfire.org Git - thirdparty/git.git/blobdiff - object.c
Merge branch 'maint'
[thirdparty/git.git] / object.c
index a23fbeaebb530fd434845182113d5a494589ebb1..7e1f2bbed2ad7f331fefc78d759acb14050bea48 100644 (file)
--- a/object.c
+++ b/object.c
@@ -199,7 +199,7 @@ struct object *parse_object(const unsigned char *sha1)
                        return NULL;
                }
 
-               obj = parse_object_buffer(repl, type, size, buffer, &eaten);
+               obj = parse_object_buffer(sha1, type, size, buffer, &eaten);
                if (!eaten)
                        free(buffer);
                return obj;
@@ -217,27 +217,6 @@ struct object_list *object_list_insert(struct object *item,
        return new_list;
 }
 
-void object_list_append(struct object *item,
-                       struct object_list **list_p)
-{
-       while (*list_p) {
-               list_p = &((*list_p)->next);
-       }
-       *list_p = xmalloc(sizeof(struct object_list));
-       (*list_p)->next = NULL;
-       (*list_p)->item = item;
-}
-
-unsigned object_list_length(struct object_list *list)
-{
-       unsigned ret = 0;
-       while (list) {
-               list = list->next;
-               ret++;
-       }
-       return ret;
-}
-
 int object_list_contains(struct object_list *list, struct object *obj)
 {
        while (list) {
@@ -273,10 +252,10 @@ void add_object_array_with_mode(struct object *obj, const char *name, struct obj
 
 void object_array_remove_duplicates(struct object_array *array)
 {
-       int ref, src, dst;
+       unsigned int ref, src, dst;
        struct object_array_entry *objects = array->objects;
 
-       for (ref = 0; ref < array->nr - 1; ref++) {
+       for (ref = 0; ref + 1 < array->nr; ref++) {
                for (src = ref + 1, dst = src;
                     src < array->nr;
                     src++) {