summaryrefslogtreecommitdiffstats
path: root/refs.h
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-05-07 09:11:39 +0200
committerJunio C Hamano <gitster@pobox.com>2024-05-07 19:06:58 +0200
commit39a9ef8fc4e7dbcb078369f9c2560ebc69bbbb1d (patch)
treee3053a95066336b71b4e4c1b9fb78f0f82ca8bf9 /refs.h
parentStart the 2.46 cycle (diff)
downloadgit-39a9ef8fc4e7dbcb078369f9c2560ebc69bbbb1d.tar.xz
git-39a9ef8fc4e7dbcb078369f9c2560ebc69bbbb1d.zip
refs: introduce missing functions that accept a `struct ref_store`
While most of the functions in "refs.h" have a variant that accepts a `struct ref_store`, some don't. Callers of these functions are thus forced to implicitly rely on `the_repository` to figure out the ref store that is to be used. Introduce those missing functions to address this shortcoming. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.h')
-rw-r--r--refs.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/refs.h b/refs.h
index d278775e08..10982dcf03 100644
--- a/refs.h
+++ b/refs.h
@@ -81,8 +81,12 @@ char *refs_resolve_refdup(struct ref_store *refs,
char *resolve_refdup(const char *refname, int resolve_flags,
struct object_id *oid, int *flags);
+int refs_read_ref_full(struct ref_store *refs, const char *refname,
+ int resolve_flags, struct object_id *oid, int *flags);
int read_ref_full(const char *refname, int resolve_flags,
struct object_id *oid, int *flags);
+
+int refs_read_ref(struct ref_store *refs, const char *refname, struct object_id *oid);
int read_ref(const char *refname, struct object_id *oid);
int refs_read_symbolic_ref(struct ref_store *ref_store, const char *refname,
@@ -375,16 +379,25 @@ int for_each_remote_ref(each_ref_fn fn, void *cb_data);
int for_each_replace_ref(struct repository *r, each_repo_ref_fn fn, void *cb_data);
/* iterates all refs that match the specified glob pattern. */
+int refs_for_each_glob_ref(struct ref_store *refs, each_ref_fn fn,
+ const char *pattern, void *cb_data);
int for_each_glob_ref(each_ref_fn fn, const char *pattern, void *cb_data);
+int refs_for_each_glob_ref_in(struct ref_store *refs, each_ref_fn fn,
+ const char *pattern, const char *prefix, void *cb_data);
int for_each_glob_ref_in(each_ref_fn fn, const char *pattern,
const char *prefix, void *cb_data);
+int refs_head_ref_namespaced(struct ref_store *refs, each_ref_fn fn, void *cb_data);
int head_ref_namespaced(each_ref_fn fn, void *cb_data);
+
/*
* references matching any pattern in "exclude_patterns" are omitted from the
* result set on a best-effort basis.
*/
+int refs_for_each_namespaced_ref(struct ref_store *refs,
+ const char **exclude_patterns,
+ each_ref_fn fn, void *cb_data);
int for_each_namespaced_ref(const char **exclude_patterns,
each_ref_fn fn, void *cb_data);