diff options
Diffstat (limited to 'refs')
-rw-r--r-- | refs/iterator.c | 6 | ||||
-rw-r--r-- | refs/packed-backend.h | 2 | ||||
-rw-r--r-- | refs/ref-cache.h | 3 | ||||
-rw-r--r-- | refs/refs-internal.h | 11 |
4 files changed, 16 insertions, 6 deletions
diff --git a/refs/iterator.c b/refs/iterator.c index 2ac91ac340..629e00a122 100644 --- a/refs/iterator.c +++ b/refs/iterator.c @@ -407,15 +407,15 @@ struct ref_iterator *prefix_ref_iterator_begin(struct ref_iterator *iter0, struct ref_iterator *current_ref_iter = NULL; -int do_for_each_ref_iterator(struct ref_iterator *iter, - each_ref_fn fn, void *cb_data) +int do_for_each_repo_ref_iterator(struct repository *r, struct ref_iterator *iter, + each_repo_ref_fn fn, void *cb_data) { int retval = 0, ok; struct ref_iterator *old_ref_iter = current_ref_iter; current_ref_iter = iter; while ((ok = ref_iterator_advance(iter)) == ITER_OK) { - retval = fn(iter->refname, iter->oid, iter->flags, cb_data); + retval = fn(r, iter->refname, iter->oid, iter->flags, cb_data); if (retval) { /* * If ref_iterator_abort() returns ITER_ERROR, diff --git a/refs/packed-backend.h b/refs/packed-backend.h index 640245d3b9..a01a0aff9c 100644 --- a/refs/packed-backend.h +++ b/refs/packed-backend.h @@ -1,6 +1,8 @@ #ifndef REFS_PACKED_BACKEND_H #define REFS_PACKED_BACKEND_H +struct ref_transaction; + /* * Support for storing references in a `packed-refs` file. * diff --git a/refs/ref-cache.h b/refs/ref-cache.h index eda65e73ed..3bfb89d2b3 100644 --- a/refs/ref-cache.h +++ b/refs/ref-cache.h @@ -1,7 +1,10 @@ #ifndef REFS_REF_CACHE_H #define REFS_REF_CACHE_H +#include "cache.h" + struct ref_dir; +struct ref_store; /* * If this ref_cache is filled lazily, this function is used to load diff --git a/refs/refs-internal.h b/refs/refs-internal.h index 04425d6d1e..f2d8c0123a 100644 --- a/refs/refs-internal.h +++ b/refs/refs-internal.h @@ -1,8 +1,12 @@ #ifndef REFS_REFS_INTERNAL_H #define REFS_REFS_INTERNAL_H +#include "cache.h" +#include "refs.h" #include "iterator.h" +struct ref_transaction; + /* * Data structures and functions for the internal use of the refs * module. Code outside of the refs module should use only the public @@ -282,7 +286,7 @@ int refs_rename_ref_available(struct ref_store *refs, * * // Access information about the current reference: * if (!(iter->flags & REF_ISSYMREF)) - * printf("%s is %s\n", iter->refname, oid_to_hex(&iter->oid)); + * printf("%s is %s\n", iter->refname, oid_to_hex(iter->oid)); * * // If you need to peel the reference: * ref_iterator_peel(iter, &oid); @@ -474,8 +478,9 @@ extern struct ref_iterator *current_ref_iter; * adapter between the callback style of reference iteration and the * iterator style. */ -int do_for_each_ref_iterator(struct ref_iterator *iter, - each_ref_fn fn, void *cb_data); +int do_for_each_repo_ref_iterator(struct repository *r, + struct ref_iterator *iter, + each_repo_ref_fn fn, void *cb_data); /* * Only include per-worktree refs in a do_for_each_ref*() iteration. |