File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -334,5 +334,21 @@ public void CanStageIgnoredPaths(string path)
334
334
Assert . Equal ( FileStatus . NewInIndex , repo . RetrieveStatus ( path ) ) ;
335
335
}
336
336
}
337
+
338
+ [ Theory ]
339
+ [ InlineData ( "new_untracked_file.txt" , FileStatus . Ignored ) ]
340
+ [ InlineData ( "modified_unstaged_file.txt" , FileStatus . ModifiedInIndex ) ]
341
+ public void IgnoredFilesAreOnlyStagedIfTheyreInTheRepo ( string filename , FileStatus expected )
342
+ {
343
+ var path = SandboxStandardTestRepoGitDir ( ) ;
344
+ using ( var repo = new Repository ( path ) )
345
+ {
346
+ File . WriteAllText ( Path . Combine ( repo . Info . WorkingDirectory , ".gitignore" ) ,
347
+ String . Format ( "{0}\n " , filename ) ) ;
348
+
349
+ repo . Stage ( filename ) ;
350
+ Assert . Equal ( expected , repo . RetrieveStatus ( filename ) ) ;
351
+ }
352
+ }
337
353
}
338
354
}
You can’t perform that action at this time.
0 commit comments