summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3870a0d)
raw | patch | inline | side by side (parent: 3870a0d)
author | Michael Haggerty <mhagger@alum.mit.edu> | |
Mon, 17 Oct 2011 02:38:07 +0000 (04:38 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 17 Oct 2011 04:10:49 +0000 (21:10 -0700) |
Make invalidate_ref_cache() an official part of the refs API. It is
currently a fact of life that code outside of refs.c mucks about with
references. This change gives such code a way of informing the refs
module that it should no longer trust its cache.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
currently a fact of life that code outside of refs.c mucks about with
references. This change gives such code a way of informing the refs
module that it should no longer trust its cache.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs.c | patch | blob | history | |
refs.h | patch | blob | history |
index 68b73aa1450f483a3116e045193a879515ecdb84..ddd799e65bdcc29ebd2dc5d530488b341b166f4d 100644 (file)
--- a/refs.c
+++ b/refs.c
return refs;
}
-static void invalidate_ref_cache(const char *submodule)
+void invalidate_ref_cache(const char *submodule)
{
clear_ref_cache(get_ref_cache(submodule));
}
index 0229c57132f53b85e4d6af8b62627383a49527ac..f439c54eb23f11e084ad9f8299d17e2ad888424b 100644 (file)
--- a/refs.h
+++ b/refs.h
/** Writes sha1 into the ref specified by the lock. **/
extern int write_ref_sha1(struct ref_lock *lock, const unsigned char *sha1, const char *msg);
+/*
+ * Invalidate the reference cache for the specified submodule. Use
+ * submodule=NULL to invalidate the cache for the main module. This
+ * function must be called if references are changed via a mechanism
+ * other than the refs API.
+ */
+extern void invalidate_ref_cache(const char *submodule);
+
/** Setup reflog before using. **/
int log_ref_setup(const char *ref_name, char *logfile, int bufsize);