summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2017-12-25 17:44:58 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-12-28 21:50:05 (GMT)
commit4ad315fc99d906364c9a5d75a319752cf4056ae5 (patch)
tree56ee9299ccc48c075d3c41714f8539f418361e1a /object.c
parent5dee6d6f28370b613ccf945b1ba8cecb0b44c172 (diff)
downloadgit-4ad315fc99d906364c9a5d75a319752cf4056ae5.zip
git-4ad315fc99d906364c9a5d75a319752cf4056ae5.tar.gz
git-4ad315fc99d906364c9a5d75a319752cf4056ae5.tar.bz2
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 <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'object.c')
-rw-r--r--object.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/object.c b/object.c
index b9a4a0e..0afdfd1 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;
+ }
+}