Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Turner <dturner@twopensource.com>2016-09-04 19:08:44 +0300
committerJunio C Hamano <gitster@pobox.com>2016-09-10 01:28:14 +0300
commit0c09ec07d1e617be5f2d7b5c937b60e77a30ede2 (patch)
treef069f2a0fd432529018dd7747baea8475236097e /refs/refs-internal.h
parent7d618264394a17e6ecd83d9412ac9ddb4609a2e5 (diff)
refs: implement iteration over only per-worktree refs
Alternate refs backends might still use files to store per-worktree refs. So provide a way to iterate over only the per-worktree references in a ref_store. The other backend can set up a files ref_store and iterate using the new DO_FOR_EACH_PER_WORKTREE_ONLY flag when iterating. Signed-off-by: David Turner <dturner@twopensource.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-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.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/refs/refs-internal.h b/refs/refs-internal.h
index 681982becd..708b26082a 100644
--- a/refs/refs-internal.h
+++ b/refs/refs-internal.h
@@ -467,10 +467,18 @@ extern struct ref_iterator *current_ref_iter;
int do_for_each_ref_iterator(struct ref_iterator *iter,
each_ref_fn fn, void *cb_data);
-/* refs backends */
+/*
+ * Only include per-worktree refs in a do_for_each_ref*() iteration.
+ * Normally this will be used with a files ref_store, since that's
+ * where all reference backends will presumably store their
+ * per-worktree refs.
+ */
+#define DO_FOR_EACH_PER_WORKTREE_ONLY 0x02
struct ref_store;
+/* refs backends */
+
/*
* Initialize the ref_store for the specified submodule, or for the
* main repository if submodule == NULL. These functions should call