bisect--helper: `bisect_clean_state` shell function in C
[gitweb.git] / builtin / reflog.c
index 96c82b4f5ef419f14425f47b2be699e7c87c3540..2067cca5b1ec4ed141a3e404cb7738c9b0ebc5d9 100644 (file)
@@ -1,4 +1,5 @@
 #include "builtin.h"
+#include "config.h"
 #include "lockfile.h"
 #include "commit.h"
 #include "refs.h"
@@ -125,7 +126,7 @@ static int commit_is_complete(struct commit *commit)
                struct commit *c;
                struct commit_list *parent;
 
-               c = (struct commit *)study.objects[--study.nr].item;
+               c = (struct commit *)object_array_pop(&study);
                if (!c->object.parsed && !parse_object(&c->object.oid))
                        c->object.flags |= INCOMPLETE;
 
@@ -181,8 +182,8 @@ static int commit_is_complete(struct commit *commit)
                        found.objects[i].item->flags |= SEEN;
        }
        /* free object arrays */
-       free(study.objects);
-       free(found.objects);
+       object_array_clear(&study);
+       object_array_clear(&found);
        return !is_incomplete;
 }