]> git.ipfire.org Git - thirdparty/git.git/commit - object-store.h
for_each_*_object: move declarations to object-store.h
authorJeff King <peff@peff.net>
Tue, 14 Aug 2018 18:21:18 +0000 (14:21 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 14 Aug 2018 19:29:57 +0000 (12:29 -0700)
commit0889aae1cd18c1804ba01c1a4229e516dfb9fe9b
tree23d7ffb8ef75b0952294270e041a8a1726016027
parent79ed0a5e2627a0e1eab0448e6f32d781e80bfafa
for_each_*_object: move declarations to object-store.h

The for_each_loose_object() and for_each_packed_object()
functions are meant to be part of a unified interface: they
use the same set of for_each_object_flags, and it's not
inconceivable that we might one day add a single
for_each_object() wrapper around them.

Let's put them together in a single file, so we can avoid
awkwardness like saying "the flags for this function are
over in cache.h". Moving the loose functions to packfile.h
is silly. Moving the packed functions to cache.h works, but
makes the "cache.h is a kitchen sink" problem worse. The
best place is the recently-created object-store.h, since
these are quite obviously related to object storage.

The for_each_*_in_objdir() functions do not use the same
flags, but they are logically part of the same interface as
for_each_loose_object(), and share callback signatures. So
we'll move those, as well, as they also make sense in
object-store.h.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/prune-packed.c
cache.h
object-store.h
packfile.h