diff options
author | Junio C Hamano <gitster@pobox.com> | 2023-07-21 22:47:26 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-07-21 22:47:26 +0200 |
commit | 39fe402d6727efb6c98ddca19fae1f094ffaa6b3 (patch) | |
tree | 816dae9b193dd9a7521d2bc213c10ff8010c277a /ls-refs.c | |
parent | The twelfth batch (diff) | |
parent | ls-refs.c: avoid enumerating hidden refs where possible (diff) | |
download | git-39fe402d6727efb6c98ddca19fae1f094ffaa6b3.tar.xz git-39fe402d6727efb6c98ddca19fae1f094ffaa6b3.zip |
Merge branch 'tb/refs-exclusion-and-packed-refs'
Enumerating refs in the packed-refs file, while excluding refs that
match certain patterns, has been optimized.
* tb/refs-exclusion-and-packed-refs:
ls-refs.c: avoid enumerating hidden refs where possible
upload-pack.c: avoid enumerating hidden refs where possible
builtin/receive-pack.c: avoid enumerating hidden references
refs.h: implement `hidden_refs_to_excludes()`
refs.h: let `for_each_namespaced_ref()` take excluded patterns
revision.h: store hidden refs in a `strvec`
refs/packed-backend.c: add trace2 counters for jump list
refs/packed-backend.c: implement jump lists to avoid excluded pattern(s)
refs/packed-backend.c: refactor `find_reference_location()`
refs: plumb `exclude_patterns` argument throughout
builtin/for-each-ref.c: add `--exclude` option
ref-filter.c: parameterize match functions over patterns
ref-filter: add `ref_filter_clear()`
ref-filter: clear reachable list pointers after freeing
ref-filter.h: provide `REF_FILTER_INIT`
refs.c: rename `ref_filter`
Diffstat (limited to 'ls-refs.c')
-rw-r--r-- | ls-refs.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -72,7 +72,7 @@ struct ls_refs_data { unsigned symrefs; struct strvec prefixes; struct strbuf buf; - struct string_list hidden_refs; + struct strvec hidden_refs; unsigned unborn : 1; }; @@ -156,7 +156,7 @@ int ls_refs(struct repository *r, struct packet_reader *request) memset(&data, 0, sizeof(data)); strvec_init(&data.prefixes); strbuf_init(&data.buf, 0); - string_list_init_dup(&data.hidden_refs); + strvec_init(&data.hidden_refs); git_config(ls_refs_config, &data); @@ -194,11 +194,12 @@ int ls_refs(struct repository *r, struct packet_reader *request) strvec_push(&data.prefixes, ""); refs_for_each_fullref_in_prefixes(get_main_ref_store(r), get_git_namespace(), data.prefixes.v, + hidden_refs_to_excludes(&data.hidden_refs), send_ref, &data); packet_fflush(stdout); strvec_clear(&data.prefixes); strbuf_release(&data.buf); - string_list_clear(&data.hidden_refs, 0); + strvec_clear(&data.hidden_refs); return 0; } |