aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2016-09-04 18:08:36 +0200
committerJunio C Hamano <gitster@pobox.com>2016-09-09 15:28:13 -0700
commit37b6f6d5f41c493bc083b5ee4c54519f8dd6d46c (patch)
tree18c250dcbfeb037ed022feecbde582c51f3ddbcb
parentfcc42ea0c92e357da40f7cbc598152e2f8dfe083 (diff)
downloadgit-37b6f6d5f41c493bc083b5ee4c54519f8dd6d46c.tar.gz
git-37b6f6d5f41c493bc083b5ee4c54519f8dd6d46c.tar.xz
files_ref_iterator_begin(): take a ref_store argument
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--refs.c2
-rw-r--r--refs/files-backend.c4
-rw-r--r--refs/refs-internal.h8
3 files changed, 7 insertions, 7 deletions
diff --git a/refs.c b/refs.c
index 3130c0e01..3d007ba02 100644
--- a/refs.c
+++ b/refs.c
@@ -1157,7 +1157,7 @@ static int do_for_each_ref(const char *submodule, const char *prefix,
if (!refs)
return 0;
- iter = files_ref_iterator_begin(submodule, prefix, flags);
+ iter = files_ref_iterator_begin(refs, prefix, flags);
iter = prefix_ref_iterator_begin(iter, prefix, trim);
return do_for_each_ref_iterator(iter, fn, cb_data);
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 9607fbd17..4918469f3 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -1863,11 +1863,11 @@ static struct ref_iterator_vtable files_ref_iterator_vtable = {
};
struct ref_iterator *files_ref_iterator_begin(
- const char *submodule,
+ struct ref_store *ref_store,
const char *prefix, unsigned int flags)
{
struct files_ref_store *refs =
- get_files_ref_store(submodule, "ref_iterator_begin");
+ files_downcast(ref_store, 1, "ref_iterator_begin");
struct ref_dir *loose_dir, *packed_dir;
struct ref_iterator *loose_iter, *packed_iter;
struct files_ref_iterator *iter;
diff --git a/refs/refs-internal.h b/refs/refs-internal.h
index 84c81ad08..0af107971 100644
--- a/refs/refs-internal.h
+++ b/refs/refs-internal.h
@@ -404,13 +404,15 @@ struct ref_iterator *prefix_ref_iterator_begin(struct ref_iterator *iter0,
const char *prefix,
int trim);
+struct ref_store;
+
/*
* Iterate over the packed and loose references in the specified
- * submodule that are within find_containing_dir(prefix). If prefix is
+ * ref_store that are within find_containing_dir(prefix). If prefix is
* NULL or the empty string, iterate over all references in the
* submodule.
*/
-struct ref_iterator *files_ref_iterator_begin(const char *submodule,
+struct ref_iterator *files_ref_iterator_begin(struct ref_store *ref_store,
const char *prefix,
unsigned int flags);
@@ -484,8 +486,6 @@ extern struct ref_iterator *current_ref_iter;
int do_for_each_ref_iterator(struct ref_iterator *iter,
each_ref_fn fn, void *cb_data);
-struct ref_store;
-
/* refs backends */
/*