summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
Diffstat (limited to 'object.c')
-rw-r--r--object.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/object.c b/object.c
index 321d7e9201..0afdfd19b7 100644
--- a/object.c
+++ b/object.c
@@ -353,6 +353,19 @@ static void object_array_release_entry(struct object_array_entry *ent)
free(ent->path);
}
+struct object *object_array_pop(struct object_array *array)
+{
+ struct object *ret;
+
+ if (!array->nr)
+ return NULL;
+
+ ret = array->objects[array->nr - 1].item;
+ object_array_release_entry(&array->objects[array->nr - 1]);
+ array->nr--;
+ return ret;
+}
+
void object_array_filter(struct object_array *array,
object_array_each_func_t want, void *cb_data)
{
@@ -421,3 +434,14 @@ void clear_object_flags(unsigned flags)
obj->flags &= ~flags;
}
}
+
+void clear_commit_marks_all(unsigned int flags)
+{
+ int i;
+
+ for (i = 0; i < obj_hash_size; i++) {
+ struct object *obj = obj_hash[i];
+ if (obj && obj->type == OBJ_COMMIT)
+ obj->flags &= ~flags;
+ }
+}