Skip to content

Commit b2639f6

Browse files
committed
we like tests that pass
1 parent c8c7955 commit b2639f6

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

LibGit2Sharp.Tests/FilterFixture.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,14 @@ private Repository CreateTestRepository(string path)
266266
{
267267
string configPath = CreateConfigurationWithDummyUser(Constants.Signature);
268268
var repositoryOptions = new RepositoryOptions { GlobalConfigurationLocation = configPath };
269-
return new Repository(path, repositoryOptions);
269+
var repository = new Repository(path, repositoryOptions);
270+
CreateAttributesFile(repository, "* filter=test");
271+
return repository;
272+
}
273+
274+
private static void CreateAttributesFile(IRepository repo, string attributeEntry)
275+
{
276+
Touch(repo.Info.WorkingDirectory, ".gitattributes", attributeEntry);
270277
}
271278

272279
class EmptyFilter : Filter

LibGit2Sharp/FilterAttributeEntry.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ public class FilterAttributeEntry
1515

1616
private readonly string filterDefinition;
1717

18+
/// <summary>
19+
/// For testing purposes
20+
/// </summary>
21+
protected FilterAttributeEntry() { }
22+
1823
/// <summary>
1924
/// The name of the filter found in a .gitattributes file
2025
/// </summary>
@@ -34,7 +39,7 @@ public FilterAttributeEntry(string filterName)
3439
/// <summary>
3540
/// The filter name in the form of 'filter=filterName'
3641
/// </summary>
37-
public string FilterDefinition
42+
public virtual string FilterDefinition
3843
{
3944
get { return filterDefinition; }
4045
}

0 commit comments

Comments
 (0)