diff options
author | René Scharfe <l.s.r@web.de> | 2017-12-25 18:44:58 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-12-28 13:50:05 -0800 |
commit | 4ad315fc99d906364c9a5d75a319752cf4056ae5 (patch) | |
tree | 56ee9299ccc48c075d3c41714f8539f418361e1a | |
parent | ref-filter: use clear_commit_marks_many() in do_merge_filter() (diff) | |
download | tgif-4ad315fc99d906364c9a5d75a319752cf4056ae5.tar.xz |
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>
-rw-r--r-- | object.c | 11 | ||||
-rw-r--r-- | object.h | 5 |
2 files changed, 16 insertions, 0 deletions
@@ -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; + } +} @@ -148,4 +148,9 @@ void object_array_clear(struct object_array *array); void clear_object_flags(unsigned flags); +/* + * Clear the specified object flags from all in-core commit objects. + */ +extern void clear_commit_marks_all(unsigned int flags); + #endif /* OBJECT_H */ |