summaryrefslogtreecommitdiff
path: root/refs.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-02-06 00:40:45 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-02-06 00:40:45 (GMT)
commit6254fa13596cee0ea645317ba3eb4552430f38b4 (patch)
tree478d0213d0acbaed6cec84a10a92670520b736bd /refs.h
parent5198426d914ae15b52f85958c224a92f48e4f95e (diff)
parentb3970c702cb0acc0551d88a5f34ad4ad2e2a6d39 (diff)
downloadgit-6254fa13596cee0ea645317ba3eb4552430f38b4.zip
git-6254fa13596cee0ea645317ba3eb4552430f38b4.tar.gz
git-6254fa13596cee0ea645317ba3eb4552430f38b4.tar.bz2
Merge branch 'tb/ls-refs-optim'
The ls-refs protocol operation has been optimized to narrow the sub-hierarchy of refs/ it walks to produce response. * tb/ls-refs-optim: ls-refs.c: traverse prefixes of disjoint "ref-prefix" sets ls-refs.c: initialize 'prefixes' before using it refs: expose 'for_each_fullref_in_prefixes'
Diffstat (limited to 'refs.h')
-rw-r--r--refs.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/refs.h b/refs.h
index 71d56cb..48970df 100644
--- a/refs.h
+++ b/refs.h
@@ -348,6 +348,15 @@ int for_each_fullref_in(const char *prefix, each_ref_fn fn, void *cb_data,
unsigned int broken);
/**
+ * iterate all refs in "patterns" by partitioning patterns into disjoint sets
+ * and iterating the longest-common prefix of each set.
+ *
+ * callers should be prepared to ignore references that they did not ask for.
+ */
+int for_each_fullref_in_prefixes(const char *namespace, const char **patterns,
+ each_ref_fn fn, void *cb_data,
+ unsigned int broken);
+/**
* iterate refs from the respective area.
*/
int for_each_tag_ref(each_ref_fn fn, void *cb_data);