1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-08 22:36:10 +02:00

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>
This commit is contained in:
René Scharfe 2017-12-25 18:44:58 +01:00 committed by Junio C Hamano
parent 5dee6d6f28
commit 4ad315fc99
2 changed files with 16 additions and 0 deletions

View File

@ -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;
}
}

View File

@ -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 */