aboutsummaryrefslogtreecommitdiff
path: root/refs/refs-internal.h
diff options
context:
space:
mode:
authorDavid Turner <dturner@twopensource.com>2016-04-07 15:02:49 -0400
committerJunio C Hamano <gitster@pobox.com>2016-04-10 11:34:55 -0700
commit937705901b83737a35996f62dbfbfefd8e5c8d7f (patch)
tree54e1be300c75deb21b7d3b650e589dcafde65ebd /refs/refs-internal.h
parent2bf68ed5aa79fcccba6ea4c021b15e51c019a85e (diff)
downloadgit-937705901b83737a35996f62dbfbfefd8e5c8d7f.tar.gz
git-937705901b83737a35996f62dbfbfefd8e5c8d7f.tar.xz
refs: move for_each_*ref* functions into common code
Make do_for_each_ref take a submodule as an argument instead of a ref_cache. Since all for_each_*ref* functions are defined in terms of do_for_each_ref, we can then move them into the common code. Later, we can simply make do_for_each_ref into a backend function. Signed-off-by: David Turner <dturner@twopensource.com> Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs/refs-internal.h')
-rw-r--r--refs/refs-internal.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/refs/refs-internal.h b/refs/refs-internal.h
index c7dded35f..92aae80c2 100644
--- a/refs/refs-internal.h
+++ b/refs/refs-internal.h
@@ -197,4 +197,13 @@ const char *find_descendant_ref(const char *dirname,
int rename_ref_available(const char *oldname, const char *newname);
+
+/* Include broken references in a do_for_each_ref*() iteration: */
+#define DO_FOR_EACH_INCLUDE_BROKEN 0x01
+
+/*
+ * The common backend for the for_each_*ref* functions
+ */
+int do_for_each_ref(const char *submodule, const char *base,
+ each_ref_fn fn, int trim, int flags, void *cb_data);
#endif /* REFS_REFS_INTERNAL_H */