object_array: add and use `object_array_pop()`
[gitweb.git] / shallow.c
index 54359d549075b5cfe1670ca979ff3cf5eeedc9d1..901ac979171e4563d09724c48478c96a212a8bb3 100644 (file)
--- a/shallow.c
+++ b/shallow.c
@@ -99,7 +99,7 @@ struct commit_list *get_shallow_commits(struct object_array *heads, int depth,
                                cur_depth = 0;
                        } else {
                                commit = (struct commit *)
-                                       stack.objects[--stack.nr].item;
+                                       object_array_pop(&stack);
                                cur_depth = *(int *)commit->util;
                        }
                }