diff options
| author | John Cai <johncai86@gmail.com> | 2023-05-12 21:34:41 +0000 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2023-05-12 14:54:14 -0700 |
| commit | 826ae79fca263bc2b70c54fddacb1603c5ebb9c6 (patch) | |
| tree | f0a65557626ded284ed05b538dc0f886c067eb82 /t/helper | |
| parent | 283174b214c4c5416772dcacbc6389dd192969a0 (diff) | |
| download | git-826ae79fca263bc2b70c54fddacb1603c5ebb9c6.tar.gz | |
pack-refs: teach --exclude option to exclude refs from being packed
At GitLab, we have a system that creates ephemeral internal refs that
don't live long before getting deleted. Having an option to exclude
certain refs from a packed-refs file allows these internal references to
be deleted much more efficiently.
Add an --exclude option to the pack-refs builtin, and use the ref
exclusions API to exclude certain refs from being packed into the final
packed-refs file
Signed-off-by: John Cai <johncai86@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/helper')
| -rw-r--r-- | t/helper/test-ref-store.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/t/helper/test-ref-store.c b/t/helper/test-ref-store.c index 6d8f844e9c..de4197708d 100644 --- a/t/helper/test-ref-store.c +++ b/t/helper/test-ref-store.c @@ -116,8 +116,9 @@ static struct flag_definition pack_flags[] = { FLAG_DEF(PACK_REFS_PRUNE), static int cmd_pack_refs(struct ref_store *refs, const char **argv) { unsigned int flags = arg_flags(*argv++, "flags", pack_flags); + struct pack_refs_opts pack_opts = { .flags = flags }; - return refs_pack_refs(refs, flags); + return refs_pack_refs(refs, &pack_opts); } static int cmd_create_symref(struct ref_store *refs, const char **argv) |
