Skip to content

Commit 4ad315f

Browse files
rscharfegitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5dee6d6 commit 4ad315f

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

object.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,3 +434,14 @@ void clear_object_flags(unsigned flags)
434434
obj->flags &= ~flags;
435435
}
436436
}
437+
438+
void clear_commit_marks_all(unsigned int flags)
439+
{
440+
int i;
441+
442+
for (i = 0; i < obj_hash_size; i++) {
443+
struct object *obj = obj_hash[i];
444+
if (obj && obj->type == OBJ_COMMIT)
445+
obj->flags &= ~flags;
446+
}
447+
}

object.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,4 +148,9 @@ void object_array_clear(struct object_array *array);
148148

149149
void clear_object_flags(unsigned flags);
150150

151+
/*
152+
* Clear the specified object flags from all in-core commit objects.
153+
*/
154+
extern void clear_commit_marks_all(unsigned int flags);
155+
151156
#endif /* OBJECT_H */

0 commit comments

Comments
 (0)