diff options
author | Keith Dahlby <dahlbyk@gmail.com> | 2013-04-25 00:06:52 +0400 |
---|---|---|
committer | Keith Dahlby <dahlbyk@gmail.com> | 2013-04-25 00:08:50 +0400 |
commit | d5c4a4461a15259acb41fe9f15f70a8f7f11d72b (patch) | |
tree | 5a6d8c155b14f6ede948014db6896e7199ee1510 /LibGit2Sharp/TreeDefinition.cs | |
parent | 00580411f2fe376bb4c0e721ca1b832a7de0044b (diff) |
Add TreeDefinition.Add(Submodule)
Diffstat (limited to 'LibGit2Sharp/TreeDefinition.cs')
-rw-r--r-- | LibGit2Sharp/TreeDefinition.cs | 12 |
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. |