object_array: add and use `object_array_pop()`
[gitweb.git] / builtin / fast-export.c
index d412c0a8f354659acade8ea6271f5c60826a0b3f..cff8d0fc5bbd8bd7acdd561b6c10ddc28e93b5bb 100644 (file)
@@ -634,11 +634,10 @@ static void handle_tail(struct object_array *commits, struct rev_info *revs)
 {
        struct commit *commit;
        while (commits->nr) {
-               commit = (struct commit *)commits->objects[commits->nr - 1].item;
+               commit = (struct commit *)object_array_pop(commits);
                if (has_unshown_parent(commit))
                        return;
                handle_commit(commit, revs);
-               commits->nr--;
        }
 }