diff options
author | Philip Kelley <phkelley@hotmail.com> | 2012-09-18 15:50:52 +0400 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2012-09-24 09:32:02 +0400 |
commit | c8f1f009e5592d4707dfc82660bed5fd40bbf8a1 (patch) | |
tree | e27a2cc98a348d80aed911b6d61f1eb5c210c9ea /LibGit2Sharp/ObjectDatabase.cs | |
parent | 7dc48e615989ceb509c318651232894eccd6db77 (diff) |
Support for custom, managed ODB backends
Diffstat (limited to 'LibGit2Sharp/ObjectDatabase.cs')
-rw-r--r-- | LibGit2Sharp/ObjectDatabase.cs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/LibGit2Sharp/ObjectDatabase.cs b/LibGit2Sharp/ObjectDatabase.cs index 35183ef2..6ce7ada3 100644 --- a/LibGit2Sharp/ObjectDatabase.cs +++ b/LibGit2Sharp/ObjectDatabase.cs @@ -66,6 +66,19 @@ namespace LibGit2Sharp return repo.Lookup<Blob>(id); } + /// <summary> + /// Adds the provided backend to the object database with the specified priority. + /// </summary> + /// <param name="backend">The backend to add</param> + /// <param name="priority">The priority at which libgit2 should consult this backend (higher values are consulted first)</param> + public virtual void AddBackend(OdbBackend backend, int priority) + { + Ensure.ArgumentNotNull(backend, "backend"); + Ensure.ArgumentConformsTo<int>(priority, s => s > 0, "priority"); + + Proxy.git_odb_add_backend(this.handle, backend.GitOdbBackendPointer, priority); + } + private class Processor { private readonly BinaryReader _reader; |