2fb90409b8
This function behaves very similarly to what we will need in pack-objects in order to implement cruft packs with expiration. But it is lacking a couple of things. Namely, it needs: - a mechanism to communicate the timestamps of individual recent objects to some external caller - and, in the case of packed objects, our future caller will also want to know the originating pack, as well as the offset within that pack at which the object can be found - finally, it needs a way to skip over packs which are marked as kept in-core. To address the first two, add a callback interface in this patch which reports the time of each recent object, as well as a (packed_git, off_t) pair for packed objects. Likewise, add a new option to the packed object iterators to skip over packs which are marked as kept in core. This option will become implicitly tested in a future patch. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 lines
507 B
C
20 lines
507 B
C
#ifndef REACHEABLE_H
|
|
#define REACHEABLE_H
|
|
|
|
#include "object.h"
|
|
|
|
struct progress;
|
|
struct rev_info;
|
|
|
|
typedef void report_recent_object_fn(const struct object *, struct packed_git *,
|
|
off_t, time_t);
|
|
|
|
int add_unseen_recent_objects_to_traversal(struct rev_info *revs,
|
|
timestamp_t timestamp,
|
|
report_recent_object_fn cb,
|
|
int ignore_in_core_kept_packs);
|
|
void mark_reachable_objects(struct rev_info *revs, int mark_reflog,
|
|
timestamp_t mark_recent, struct progress *);
|
|
|
|
#endif
|