path: root/refs.h
diff options
authorMichael Haggerty <>2012-01-17 05:50:33 (GMT)
committerJunio C Hamano <>2012-01-17 19:55:04 (GMT)
commit30249ee68fa5fa63bfb9bb417987b0547253b8e7 (patch)
treefd474eab1ad3af967bafb425fa6bcc00b209ebc5 /refs.h
parente6ed3ca651fac702f9d9a9ef64a14c7efadf7365 (diff)
add_packed_ref(): new function in the refs API.
Add a new function add_packed_ref() that adds a reference directly to the in-memory packed reference cache. This will be useful for creating local references while cloning. Signed-off-by: Michael Haggerty <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'refs.h')
1 files changed, 6 insertions, 0 deletions
diff --git a/refs.h b/refs.h
index d498291..00ba1e2 100644
--- a/refs.h
+++ b/refs.h
@@ -51,6 +51,12 @@ extern int for_each_rawref(each_ref_fn, void *);
extern void warn_dangling_symref(FILE *fp, const char *msg_fmt, const char *refname);
+ * Add a reference to the in-memory packed reference cache. To actually
+ * write the reference to the packed-refs file, call pack_refs().
+ */
+extern void add_packed_ref(const char *refname, const unsigned char *sha1);
* 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