refs: add a backend method structure
[gitweb.git] / refs / refs-internal.h
index efe584701b7c324a25ab7b20df98b5cbbadbd795..2c9d134021cffca8f950a45baadd4af740273b34 100644 (file)
@@ -240,7 +240,17 @@ const char *find_descendant_ref(const char *dirname,
                                const struct string_list *extras,
                                const struct string_list *skip);
 
-int rename_ref_available(const char *oldname, const char *newname);
+/*
+ * Check whether an attempt to rename old_refname to new_refname would
+ * cause a D/F conflict with any existing reference (other than
+ * possibly old_refname). If there would be a conflict, emit an error
+ * message and return false; otherwise, return true.
+ *
+ * Note that this function is not safe against all races with other
+ * processes (though rename_ref() catches some races that might get by
+ * this check).
+ */
+int rename_ref_available(const char *old_refname, const char *new_refname);
 
 /* We allow "recursive" symbolic refs. Only within reason, though */
 #define SYMREF_MAXDEPTH 5
@@ -515,4 +525,12 @@ int do_for_each_ref_iterator(struct ref_iterator *iter,
 int read_raw_ref(const char *refname, unsigned char *sha1,
                 struct strbuf *referent, unsigned int *type);
 
+/* refs backends */
+struct ref_storage_be {
+       struct ref_storage_be *next;
+       const char *name;
+};
+
+extern struct ref_storage_be refs_be_files;
+
 #endif /* REFS_REFS_INTERNAL_H */