path: root/refs.h
diff options
authorDaniel Barkalow <>2008-04-27 17:39:24 (GMT)
committerJunio C Hamano <>2008-05-05 00:41:44 (GMT)
commite142a3c61d22c3a3c081cb2c693e4d3725c21522 (patch)
treef04f3e2ba47327027bafa728e914b7d64434c3c8 /refs.h
parente0aaa29ff324c40a6428d5cc26867392eedf94ad (diff)
Allow for having for_each_ref() list extra refs
These refs can be anything, but they are most likely useful as pointing to objects that you know are in the object database but don't have any regular refs for. For example, when cloning with --reference, the refs in this repository should be listed as objects that we have, even though we don't have refs in our newly-created repository for them yet. Signed-off-by: Daniel Barkalow <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'refs.h')
1 files changed, 9 insertions, 0 deletions
diff --git a/refs.h b/refs.h
index 06abee1..06ad260 100644
--- a/refs.h
+++ b/refs.h
@@ -24,6 +24,15 @@ extern int for_each_tag_ref(each_ref_fn, void *);
extern int for_each_branch_ref(each_ref_fn, void *);
extern int for_each_remote_ref(each_ref_fn, void *);
+ * Extra refs will be listed by for_each_ref() before any actual refs
+ * for the duration of this process or until clear_extra_refs() is
+ * called. Only extra refs added before for_each_ref() is called will
+ * be listed on a given call of for_each_ref().
+ */
+extern void add_extra_ref(const char *refname, const unsigned char *sha1, int flags);
+extern void clear_extra_refs(void);
extern int peel_ref(const char *, unsigned char *);
/** Locks a "refs/" ref returning the lock on success and NULL on failure. **/