From 4ad315fc99d906364c9a5d75a319752cf4056ae5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Mon, 25 Dec 2017 18:44:58 +0100 Subject: object: add clear_commit_marks_all() Add a function for clearing the commit marks of all in-core commit objects. It's similar to clear_object_flags(), but more precise, since it leaves the other object types alone. It still has to iterate through them, though. Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- object.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'object.c') diff --git a/object.c b/object.c index b9a4a0e501..0afdfd19b7 100644 --- a/object.c +++ b/object.c @@ -434,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; + } +} -- cgit v1.2.3