summaryrefslogtreecommitdiff
path: root/refs.h
diff options
context:
space:
mode:
authorDaniel Barkalow <barkalow@iabervon.org>2008-04-27 13:39:24 -0400
committerJunio C Hamano <gitster@pobox.com>2008-05-04 17:41:44 -0700
commite142a3c61d22c3a3c081cb2c693e4d3725c21522 (patch)
treef04f3e2ba47327027bafa728e914b7d64434c3c8 /refs.h
parente0aaa29ff324c40a6428d5cc26867392eedf94ad (diff)
downloadgit-e142a3c61d22c3a3c081cb2c693e4d3725c21522.tar.gz
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 <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.h')
-rw-r--r--refs.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/refs.h b/refs.h
index 06abee1526..06ad260556 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. **/