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

TreeDefinitionExtensions.cs « LibGit2Sharp - github.com/mono/libgit2sharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4ff8c62cbf8b41dbd1d949ae41c95432867e830b (plain)
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;
        }
    }
}