1- using LibGit2Sharp . Tests . TestHelpers ;
2- using System ;
1+ using System ;
32using System . Collections . Generic ;
43using System . IO ;
54using System . Linq ;
5+ using LibGit2Sharp . Tests . TestHelpers ;
66using Xunit ;
77
88namespace LibGit2Sharp . Tests
@@ -252,7 +252,6 @@ public void CanAddWorktree_WithUncommitedChanges()
252252 Assert . Equal ( 3 , repo . Worktrees . Count ( ) ) ;
253253
254254 // Check that branch contains same number of files and folders
255- // NOTE: There is an open bug - [Repository.Worktrees.Add leaves now worktree empty](https://github.com/libgit2/libgit2sharp/issues/2037)
256255 Assert . True ( repo . RetrieveStatus ( ) . IsDirty ) ;
257256 var filesInMain = GetFilesOfRepo ( repoPath ) ;
258257 var filesInBranch = GetFilesOfRepo ( path ) ;
@@ -289,7 +288,6 @@ public void CanAddWorktree_WithCommitedChanges()
289288 Assert . Equal ( 3 , repo . Worktrees . Count ( ) ) ;
290289
291290 // Check that branch contains same number of files and folders
292- // NOTE: There is an open bug - [Repository.Worktrees.Add leaves now worktree empty](https://github.com/libgit2/libgit2sharp/issues/2037)
293291 Assert . False ( repo . RetrieveStatus ( ) . IsDirty ) ;
294292 var filesInMain = GetFilesOfRepo ( repoPath ) ;
295293 var filesInBranch = GetFilesOfRepo ( path ) ;
@@ -314,7 +312,6 @@ public void CanAddLockedWorktree_WithUncommitedChanges()
314312 Assert . Equal ( 3 , repo . Worktrees . Count ( ) ) ;
315313
316314 // Check that branch contains same number of files and folders
317- // NOTE: There is an open bug - [Repository.Worktrees.Add leaves now worktree empty](https://github.com/libgit2/libgit2sharp/issues/2037)
318315 Assert . True ( repo . RetrieveStatus ( ) . IsDirty ) ;
319316 var filesInMain = GetFilesOfRepo ( repoPath ) ;
320317 var filesInBranch = GetFilesOfRepo ( path ) ;
@@ -351,7 +348,6 @@ public void CanAddLockedWorktree_WithCommitedChanges()
351348 Assert . Equal ( 3 , repo . Worktrees . Count ( ) ) ;
352349
353350 // Check that branch contains same number of files and folders
354- // NOTE: There is an open bug - [Repository.Worktrees.Add leaves now worktree empty](https://github.com/libgit2/libgit2sharp/issues/2037)
355351 Assert . False ( repo . RetrieveStatus ( ) . IsDirty ) ;
356352 var filesInMain = GetFilesOfRepo ( repoPath ) ;
357353 var filesInBranch = GetFilesOfRepo ( path ) ;
@@ -380,7 +376,6 @@ public void CanAddWorktreeForCommittish()
380376 Assert . Equal ( 3 , repo . Worktrees . Count ( ) ) ;
381377
382378 // Check that branch contains same number of files and folders
383- // NOTE: There is an open bug - [Repository.Worktrees.Add leaves now worktree empty](https://github.com/libgit2/libgit2sharp/issues/2037)
384379 var filesInCommittish = new string [ ] { "numbers.txt" , "super-file.txt" } ;
385380 var filesInBranch = GetFilesOfRepo ( path ) ;
386381 Assert . Equal ( filesInCommittish , filesInBranch ) ;
@@ -390,9 +385,9 @@ public void CanAddWorktreeForCommittish()
390385 private static IEnumerable < string > GetFilesOfRepo ( string repoPath )
391386 {
392387 return Directory . GetFiles ( repoPath , "*" , SearchOption . AllDirectories )
393- . Where ( fileName => ! fileName . StartsWith ( $ "{ repoPath } \\ .git", StringComparison . InvariantCultureIgnoreCase ) )
394- . Select ( fileName => fileName . Replace ( $ "{ repoPath } \\ ", "" , StringComparison . InvariantCultureIgnoreCase ) )
395- . OrderBy ( fileName => fileName , StringComparer . InvariantCultureIgnoreCase )
388+ . Where ( fileName => ! fileName . StartsWith ( $ "{ repoPath } \\ .git") )
389+ . Select ( fileName => fileName . Replace ( $ "{ repoPath } \\ ", "" ) )
390+ . OrderBy ( fileName => fileName )
396391 . ToList ( ) ;
397392 }
398393 }
0 commit comments