Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2sharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2012-04-16 23:56:18 +0400
committernulltoken <emeric.fermas@gmail.com>2012-04-28 05:32:17 +0400
commit660d27aff85f01c608dbe1b014c3d1bc9faa3939 (patch)
treeed6095b6b24b491ef65dc47923e3747944cb535f /LibGit2Sharp/ObjectDatabase.cs
parent77fd1e48d22b99dbcac789ae014edaf9328776c2 (diff)
Add Repository.ObjectDatabase.CreateTree()
Diffstat (limited to 'LibGit2Sharp/ObjectDatabase.cs')
-rw-r--r--LibGit2Sharp/ObjectDatabase.cs10
1 files changed, 10 insertions, 0 deletions
diff --git a/LibGit2Sharp/ObjectDatabase.cs b/LibGit2Sharp/ObjectDatabase.cs
index 293cf8de..1a430440 100644
--- a/LibGit2Sharp/ObjectDatabase.cs
+++ b/LibGit2Sharp/ObjectDatabase.cs
@@ -49,5 +49,15 @@ namespace LibGit2Sharp
Ensure.Success(NativeMethods.git_blob_create_fromfile(ref oid, repo.Handle, path));
return repo.Lookup<Blob>(new ObjectId(oid));
}
+
+ /// <summary>
+ /// Inserts a <see cref = "Tree"/> into the object database, created from a <see cref = "TreeDefinition"/>.
+ /// </summary>
+ /// <param name = "treeDefinition">The <see cref = "TreeDefinition"/>.</param>
+ /// <returns>The created <see cref = "Tree"/>.</returns>
+ public Tree CreateTree(TreeDefinition treeDefinition)
+ {
+ return treeDefinition.Build(repo);
+ }
}
}