File tree Expand file tree Collapse file tree 3 files changed +45
-1
lines changed Expand file tree Collapse file tree 3 files changed +45
-1
lines changed Original file line number Diff line number Diff line change
1
+ using System ;
2
+ using System . Collections . Generic ;
3
+ using System . IO ;
4
+ using System . Linq ;
5
+ using System . Text ;
6
+ using LibGit2Sharp . Tests . TestHelpers ;
7
+ using Xunit ;
8
+
9
+ namespace LibGit2Sharp . Tests
10
+ {
11
+ public class IgnoreFixture : BaseFixture
12
+ {
13
+ [ Fact ]
14
+ public void TemporaryRulesShouldApplyUntilCleared ( )
15
+ {
16
+ TemporaryCloneOfTestRepo path = BuildTemporaryCloneOfTestRepo ( StandardTestRepoWorkingDirPath ) ;
17
+ using ( var repo = new Repository ( path . RepositoryPath ) )
18
+ {
19
+ File . WriteAllText ( Path . Combine ( repo . Info . WorkingDirectory , "Foo.cs" ) , "Bar" ) ;
20
+
21
+ Assert . True ( repo . Index . RetrieveStatus ( ) . Untracked . Contains ( "Foo.cs" ) ) ;
22
+
23
+ repo . Ignore . AddTemporaryRules ( new [ ] { "*.cs" } ) ;
24
+
25
+ Assert . False ( repo . Index . RetrieveStatus ( ) . Untracked . Contains ( "Foo.cs" ) ) ;
26
+
27
+ repo . Ignore . ResetAllTemporaryRules ( ) ;
28
+
29
+ Assert . True ( repo . Index . RetrieveStatus ( ) . Untracked . Contains ( "Foo.cs" ) ) ;
30
+ }
31
+ }
32
+
33
+ [ Fact ]
34
+ public void IsPathIgnoredShouldVerifyWhetherPathIsIgnored ( )
35
+ {
36
+ TemporaryCloneOfTestRepo path = BuildTemporaryCloneOfTestRepo ( StandardTestRepoWorkingDirPath ) ;
37
+ using ( var repo = new Repository ( path . RepositoryPath ) )
38
+ {
39
+
40
+ }
41
+ }
42
+ }
43
+ }
Original file line number Diff line number Diff line change 59
59
<ItemGroup >
60
60
<Compile Include =" CheckoutFixture.cs" />
61
61
<Compile Include =" CloneFixture.cs" />
62
+ <Compile Include =" IgnoreFixture.cs" />
62
63
<Compile Include =" MergeFixture.cs" />
63
64
<Compile Include =" CleanFixture.cs" />
64
65
<Compile Include =" CurrentOperationFixture.cs" />
Original file line number Diff line number Diff line change @@ -195,7 +195,7 @@ public Ignore Ignore
195
195
{
196
196
get
197
197
{
198
- return Ignore ;
198
+ return ignore ;
199
199
}
200
200
}
201
201
You can’t perform that action at this time.
0 commit comments