summaryrefslogtreecommitdiff
path: root/include/git2/odb.h
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2012-11-28 10:47:10 +0100
committerVicent Marti <tanoku@gmail.com>2012-11-28 10:47:10 +0100
commit9507a434c6a1e70ccd8a2678fe35b092105be1db (patch)
tree73f8b9464e513337589a982ddfa54beb4bd677ea /include/git2/odb.h
parent64c5112188647fcbfbe2bbfb897abfbc21912ba8 (diff)
downloadlibgit2-9507a434c6a1e70ccd8a2678fe35b092105be1db.tar.gz
odb: Add `git_odb_add_disk_alternate`
Loads a disk alternate by path to the ODB. Mimics the `GIT_ALTERNATE_OBJECT_DIRECTORIES` shell var.
Diffstat (limited to 'include/git2/odb.h')
-rw-r--r--include/git2/odb.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/git2/odb.h b/include/git2/odb.h
index f2633d11c..3854fa6f6 100644
--- a/include/git2/odb.h
+++ b/include/git2/odb.h
@@ -89,6 +89,23 @@ GIT_EXTERN(int) git_odb_add_backend(git_odb *odb, git_odb_backend *backend, int
GIT_EXTERN(int) git_odb_add_alternate(git_odb *odb, git_odb_backend *backend, int priority);
/**
+ * Add an on-disk alternate to an existing Object DB.
+ *
+ * Note that the added path must point to an `objects`, not
+ * to a full repository, to use it as an alternate store.
+ *
+ * Alternate backends are always checked for objects *after*
+ * all the main backends have been exhausted.
+ *
+ * Writing is disabled on alternate backends.
+ *
+ * @param odb database to add the backend to
+ * @param path path to the objects folder for the alternate
+ * @return 0 on success; error code otherwise
+ */
+GIT_EXTERN(int) git_odb_add_disk_alternate(git_odb *odb, const char *path);
+
+/**
* Close an open object database.
*
* @param db database pointer to close. If NULL no action is taken.