Skip to content

Commit c8c7955

Browse files
committed
Rename filter attribute
1 parent e0a3814 commit c8c7955

File tree

6 files changed

+17
-17
lines changed

6 files changed

+17
-17
lines changed

LibGit2Sharp.Tests/FilterFixture.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class FilterFixture : BaseFixture
1313
readonly Func<Stream, Stream, int> successCallback = (reader, writer) => 0;
1414

1515
private const string FilterName = "the-filter";
16-
readonly List<FilterAttribute> attributes = new List<FilterAttribute> { new FilterAttribute("test") };
16+
readonly List<FilterAttributeEntry> attributes = new List<FilterAttributeEntry> { new FilterAttributeEntry("test") };
1717

1818
[Fact]
1919
public void CanRegisterFilterWithSingleAttribute()
@@ -271,7 +271,7 @@ private Repository CreateTestRepository(string path)
271271

272272
class EmptyFilter : Filter
273273
{
274-
public EmptyFilter(string name, IEnumerable<FilterAttribute> attributes)
274+
public EmptyFilter(string name, IEnumerable<FilterAttributeEntry> attributes)
275275
: base(name, attributes)
276276
{ }
277277
}
@@ -282,7 +282,7 @@ class FakeFilter : Filter
282282
private readonly Func<Stream, Stream, int> smudgeCallback;
283283
private readonly Func<int> initCallback;
284284

285-
public FakeFilter(string name, IEnumerable<FilterAttribute> attributes,
285+
public FakeFilter(string name, IEnumerable<FilterAttributeEntry> attributes,
286286
Func<Stream, Stream, int> cleanCallback = null,
287287
Func<Stream, Stream, int> smudgeCallback = null,
288288
Func<int> initCallback = null)

LibGit2Sharp.Tests/FilterSubstitutionCipherFixture.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public void SmugdeIsNotCalledForFileWhichDoesNotMatchAnAttributeEntry()
1515
const string decodedInput = "This is a substitution cipher";
1616
const string encodedInput = "Guvf vf n fhofgvghgvba pvcure";
1717

18-
var attributes = new List<FilterAttribute> { new FilterAttribute("filter=rot13") };
18+
var attributes = new List<FilterAttributeEntry> { new FilterAttributeEntry("filter=rot13") };
1919
var filter = new SubstitutionCipherFilter("cipher-filter", attributes);
2020
var filterRegistration = GlobalSettings.RegisterFilter(filter);
2121

@@ -55,7 +55,7 @@ public void CorrectlyEncodesAndDecodesInput()
5555
const string decodedInput = "This is a substitution cipher";
5656
const string encodedInput = "Guvf vf n fhofgvghgvba pvcure";
5757

58-
var attributes = new List<FilterAttribute> { new FilterAttribute("filter=rot13") };
58+
var attributes = new List<FilterAttributeEntry> { new FilterAttributeEntry("filter=rot13") };
5959
var filter = new SubstitutionCipherFilter("cipher-filter", attributes);
6060
var filterRegistration = GlobalSettings.RegisterFilter(filter);
6161

@@ -98,7 +98,7 @@ public void WhenStagedFileDoesNotMatchPathSpecFileIsNotFiltered(string pathSpec,
9898
const string decodedInput = "This is a substitution cipher";
9999
string attributeFileEntry = string.Format("{0} {1}", pathSpec, filterName);
100100

101-
var filterForAttributes = new List<FilterAttribute> { new FilterAttribute(filterName) };
101+
var filterForAttributes = new List<FilterAttributeEntry> { new FilterAttributeEntry(filterName) };
102102
var filter = new SubstitutionCipherFilter("cipher-filter", filterForAttributes);
103103

104104
var filterRegistration = GlobalSettings.RegisterFilter(filter);
@@ -135,7 +135,7 @@ public void CleanIsCalledIfAttributeEntryMatches(string filterAttribute, string
135135
{
136136
const string decodedInput = "This is a substitution cipher";
137137

138-
var filterForAttributes = new List<FilterAttribute> { new FilterAttribute(filterAttribute) };
138+
var filterForAttributes = new List<FilterAttributeEntry> { new FilterAttributeEntry(filterAttribute) };
139139
var filter = new SubstitutionCipherFilter("cipher-filter", filterForAttributes);
140140

141141
var filterRegistration = GlobalSettings.RegisterFilter(filter);
@@ -168,7 +168,7 @@ public void SmudgeIsCalledIfAttributeEntryMatches(string filterAttribute, string
168168
{
169169
const string decodedInput = "This is a substitution cipher";
170170

171-
var filterForAttributes = new List<FilterAttribute> { new FilterAttribute(filterAttribute) };
171+
var filterForAttributes = new List<FilterAttributeEntry> { new FilterAttributeEntry(filterAttribute) };
172172
var filter = new SubstitutionCipherFilter("cipher-filter", filterForAttributes);
173173

174174
var filterRegistration = GlobalSettings.RegisterFilter(filter);

LibGit2Sharp.Tests/TestHelpers/SubstitutionCipherFilter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public class SubstitutionCipherFilter : Filter
88
public int CleanCalledCount = 0;
99
public int SmudgeCalledCount = 0;
1010

11-
public SubstitutionCipherFilter(string name, IEnumerable<FilterAttribute> attributes)
11+
public SubstitutionCipherFilter(string name, IEnumerable<FilterAttributeEntry> attributes)
1212
: base(name, attributes)
1313
{
1414
}

LibGit2Sharp/Filter.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public abstract class Filter : IEquatable<Filter>
1717
new LambdaEqualityHelper<Filter>(x => x.Name, x => x.Attributes);
1818

1919
private readonly string name;
20-
private readonly IEnumerable<FilterAttribute> attributes;
20+
private readonly IEnumerable<FilterAttributeEntry> attributes;
2121

2222
private readonly GitFilter gitFilter;
2323

@@ -27,7 +27,7 @@ public abstract class Filter : IEquatable<Filter>
2727
/// <param name="name">The unique name with which this filtered is registered with</param>
2828
/// <param name="filterAttributes">A list of attributes which this filter applies to</param>
2929
/// </summary>
30-
protected Filter(string name, IEnumerable<FilterAttribute> attributes)
30+
protected Filter(string name, IEnumerable<FilterAttributeEntry> attributes)
3131
{
3232
Ensure.ArgumentNotNullOrEmptyString(name, "name");
3333
Ensure.ArgumentNotNull(attributes, "attributes");
@@ -55,7 +55,7 @@ public string Name
5555
/// <summary>
5656
/// The filter filterForAttributes.
5757
/// </summary>
58-
public IEnumerable<FilterAttribute> Attributes
58+
public IEnumerable<FilterAttributeEntry> Attributes
5959
{
6060
get { return attributes; }
6161
}

LibGit2Sharp/FilterAttribute.cs renamed to LibGit2Sharp/FilterAttributeEntry.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ namespace LibGit2Sharp
55
/// <summary>
66
/// The definition for a given filter found in the .gitattributes file.
77
/// The filter definition will result as 'filter=filterName'
8-
///
8+
///
99
/// In the .gitattributes file a filter will be matched to a pathspec like so
1010
/// '*.txt filter=filterName'
1111
/// </summary>
12-
public class FilterAttribute
12+
public class FilterAttributeEntry
1313
{
1414
private const string AttributeFilterDefinition = "filter=";
1515

@@ -19,7 +19,7 @@ public class FilterAttribute
1919
/// The name of the filter found in a .gitattributes file
2020
/// </summary>
2121
/// <param name="filterName">The name of the filter</param>
22-
public FilterAttribute(string filterName)
22+
public FilterAttributeEntry(string filterName)
2323
{
2424
Ensure.ArgumentNotNullOrEmptyString(filterName, "filterName");
2525

@@ -39,4 +39,4 @@ public string FilterDefinition
3939
get { return filterDefinition; }
4040
}
4141
}
42-
}
42+
}

LibGit2Sharp/LibGit2Sharp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
<Compile Include="Core\Handles\IndexReucEntrySafeHandle.cs" />
8282
<Compile Include="EntryExistsException.cs" />
8383
<Compile Include="FetchOptionsBase.cs" />
84-
<Compile Include="FilterAttribute.cs" />
84+
<Compile Include="FilterAttributeEntry.cs" />
8585
<Compile Include="FilterMode.cs" />
8686
<Compile Include="FilterRegistration.cs" />
8787
<Compile Include="FilterSource.cs" />

0 commit comments

Comments
 (0)