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:
authorKeith Dahlby <dahlbyk@gmail.com>2013-04-25 00:06:52 +0400
committerKeith Dahlby <dahlbyk@gmail.com>2013-04-25 00:08:50 +0400
commitd5c4a4461a15259acb41fe9f15f70a8f7f11d72b (patch)
tree5a6d8c155b14f6ede948014db6896e7199ee1510 /LibGit2Sharp/TreeDefinition.cs
parent00580411f2fe376bb4c0e721ca1b832a7de0044b (diff)
Add TreeDefinition.Add(Submodule)
Diffstat (limited to 'LibGit2Sharp/TreeDefinition.cs')
-rw-r--r--LibGit2Sharp/TreeDefinition.cs12
1 files changed, 12 insertions, 0 deletions
diff --git a/LibGit2Sharp/TreeDefinition.cs b/LibGit2Sharp/TreeDefinition.cs
index 950e286b..5e66626a 100644
--- a/LibGit2Sharp/TreeDefinition.cs
+++ b/LibGit2Sharp/TreeDefinition.cs
@@ -175,6 +175,18 @@ namespace LibGit2Sharp
}
/// <summary>
+ /// Adds or replaces a gitlink <see cref="TreeEntryDefinition"/> equivalent to <paramref name="submodule"/>.
+ /// </summary>
+ /// <param name="submodule">The <see cref="Submodule"/> to be linked.</param>
+ /// <returns>The current <see cref="TreeDefinition"/>.</returns>
+ public virtual TreeDefinition Add(Submodule submodule)
+ {
+ Ensure.ArgumentNotNull(submodule, "submodule");
+
+ return AddGitLink(submodule.Path, submodule.HeadCommitId);
+ }
+
+ /// <summary>
/// Adds or replaces a gitlink <see cref="TreeEntryDefinition"/>,
/// referencing the commit identified by <paramref name="objectId"/>,
/// at the specified <paramref name="targetTreeEntryPath"/> location.