alternates: provide helper for adding to alternates list
[gitweb.git] / cache.h
diff --git a/cache.h b/cache.h
index 6fc0e5ae68a6965c8be3b822400145095b56f755..258ce6b0f06d7395818c8cd2e2de96fe894f29c0 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -1389,10 +1389,22 @@ extern struct alternate_object_database {
 extern void prepare_alt_odb(void);
 extern void read_info_alternates(const char * relative_base, int depth);
 extern char *compute_alternate_path(const char *path, struct strbuf *err);
-extern void add_to_alternates_file(const char *reference);
 typedef int alt_odb_fn(struct alternate_object_database *, void *);
 extern int foreach_alt_odb(alt_odb_fn, void*);
 
+/*
+ * Add the directory to the on-disk alternates file; the new entry will also
+ * take effect in the current process.
+ */
+extern void add_to_alternates_file(const char *dir);
+
+/*
+ * Add the directory to the in-memory list of alternates (along with any
+ * recursive alternates it points to), but do not modify the on-disk alternates
+ * file.
+ */
+extern void add_to_alternates_memory(const char *dir);
+
 struct pack_window {
        struct pack_window *next;
        unsigned char *base;