diff options
author | Taylor Blau <me@ttaylorr.com> | 2021-09-29 03:55:01 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-09-29 06:20:55 +0200 |
commit | 56d863e9799c9d440eba3e61346662745a58ab21 (patch) | |
tree | 2af68ea9687f6b51aecc882fab79405d7d587077 /midx.h | |
parent | pack-bitmap: drop bitmap_index argument from try_partial_reuse() (diff) | |
download | git-56d863e9799c9d440eba3e61346662745a58ab21.tar.xz git-56d863e9799c9d440eba3e61346662745a58ab21.zip |
midx: expose `write_midx_file_only()` publicly
Expose a variant of the write_midx_file() function which ignores packs
that aren't included in an explicit "allow" list.
This will be used in an upcoming patch to power a new `--stdin-packs`
mode of `git multi-pack-index write` for callers that only want to
include certain packs in a MIDX (and ignore any packs which may have
happened to enter the repository independently, e.g., from pushes).
Those patches will provide test coverage for this new function.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'midx.h')
-rw-r--r-- | midx.h | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -2,6 +2,7 @@ #define MIDX_H #include "repository.h" +#include "string-list.h" struct object_id; struct pack_entry; @@ -62,6 +63,14 @@ int midx_contains_pack(struct multi_pack_index *m, const char *idx_or_pack_name) int prepare_multi_pack_index_one(struct repository *r, const char *object_dir, int local); int write_midx_file(const char *object_dir, const char *preferred_pack_name, unsigned flags); +/* + * Variant of write_midx_file which writes a MIDX containing only the packs + * specified in packs_to_include. + */ +int write_midx_file_only(const char *object_dir, + struct string_list *packs_to_include, + const char *preferred_pack_name, + unsigned flags); void clear_midx_file(struct repository *r); int verify_midx_file(struct repository *r, const char *object_dir, unsigned flags); int expire_midx_packs(struct repository *r, const char *object_dir, unsigned flags); |