summaryrefslogtreecommitdiff
path: root/include/git2/repository.h
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2013-03-01 15:37:33 -0600
committerEdward Thomson <ethomson@edwardthomson.com>2013-03-07 11:01:52 -0600
commitd00d54645d931c77a9b401518c0d73e3f640454b (patch)
treee1932dcc97172a53524e9db1ba4923cf137a4f9c /include/git2/repository.h
parent6a9ef012376e8a21dcfd0499ab16048eb6e954c3 (diff)
downloadlibgit2-d00d54645d931c77a9b401518c0d73e3f640454b.tar.gz
immutable references and a pluggable ref database
Diffstat (limited to 'include/git2/repository.h')
-rw-r--r--include/git2/repository.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/include/git2/repository.h b/include/git2/repository.h
index e207e5bb5..e75c8b136 100644
--- a/include/git2/repository.h
+++ b/include/git2/repository.h
@@ -434,6 +434,39 @@ GIT_EXTERN(int) git_repository_odb(git_odb **out, git_repository *repo);
GIT_EXTERN(void) git_repository_set_odb(git_repository *repo, git_odb *odb);
/**
+ * Get the Reference Database Backend for this repository.
+ *
+ * If a custom refsdb has not been set, the default database for
+ * the repository will be returned (the one that manipulates loose
+ * and packed references in the `.git` directory).
+ *
+ * The refdb must be freed once it's no longer being used by
+ * the user.
+ *
+ * @param out Pointer to store the loaded refdb
+ * @param repo A repository object
+ * @return 0, or an error code
+ */
+GIT_EXTERN(int) git_repository_refdb(git_refdb **out, git_repository *repo);
+
+/**
+ * Set the Reference Database Backend for this repository
+ *
+ * The refdb will be used for all reference related operations
+ * involving this repository.
+ *
+ * The repository will keep a reference to the refdb; the user
+ * must still free the refdb object after setting it to the
+ * repository, or it will leak.
+ *
+ * @param repo A repository object
+ * @param refdb An refdb object
+ */
+GIT_EXTERN(void) git_repository_set_refdb(
+ git_repository *repo,
+ git_refdb *refdb);
+
+/**
* Get the Index file for this repository.
*
* If a custom index has not been set, the default