forked from libgit2/libgit2sharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTreeDefinitionExtensions.cs
31 lines (28 loc) · 1.05 KB
/
TreeDefinitionExtensions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using System.Collections.Generic;
using LibGit2Sharp.Core;
namespace LibGit2Sharp
{
/// <summary>
/// Provides helper overloads to a <see cref="TreeDefinition"/>.
/// </summary>
public static class TreeDefinitionExtensions
{
/// <summary>
/// Removes the <see cref="TreeEntryDefinition"/> located at each of the
/// specified <paramref name="treeEntryPaths"/>.
/// </summary>
/// <param name="td">The <see cref="TreeDefinition"/>.</param>
/// <param name="treeEntryPaths">The paths within this <see cref="TreeDefinition"/>.</param>
/// <returns>The current <see cref="TreeDefinition"/>.</returns>
public static TreeDefinition Remove(this TreeDefinition td, IEnumerable<string> treeEntryPaths)
{
Ensure.ArgumentNotNull(td, "td");
Ensure.ArgumentNotNull(treeEntryPaths, "treeEntryPaths");
foreach (var treeEntryPath in treeEntryPaths)
{
td.Remove(treeEntryPath);
}
return td;
}
}
}