1
- using LibGit2Sharp . Tests . TestHelpers ;
2
- using System ;
1
+ using System ;
3
2
using System . Collections . Generic ;
4
3
using System . IO ;
5
4
using System . Linq ;
5
+ using LibGit2Sharp . Tests . TestHelpers ;
6
6
using Xunit ;
7
7
8
8
namespace LibGit2Sharp . Tests
@@ -252,7 +252,6 @@ public void CanAddWorktree_WithUncommitedChanges()
252
252
Assert . Equal ( 3 , repo . Worktrees . Count ( ) ) ;
253
253
254
254
// 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)
256
255
Assert . True ( repo . RetrieveStatus ( ) . IsDirty ) ;
257
256
var filesInMain = GetFilesOfRepo ( repoPath ) ;
258
257
var filesInBranch = GetFilesOfRepo ( path ) ;
@@ -289,7 +288,6 @@ public void CanAddWorktree_WithCommitedChanges()
289
288
Assert . Equal ( 3 , repo . Worktrees . Count ( ) ) ;
290
289
291
290
// 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)
293
291
Assert . False ( repo . RetrieveStatus ( ) . IsDirty ) ;
294
292
var filesInMain = GetFilesOfRepo ( repoPath ) ;
295
293
var filesInBranch = GetFilesOfRepo ( path ) ;
@@ -314,7 +312,6 @@ public void CanAddLockedWorktree_WithUncommitedChanges()
314
312
Assert . Equal ( 3 , repo . Worktrees . Count ( ) ) ;
315
313
316
314
// 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)
318
315
Assert . True ( repo . RetrieveStatus ( ) . IsDirty ) ;
319
316
var filesInMain = GetFilesOfRepo ( repoPath ) ;
320
317
var filesInBranch = GetFilesOfRepo ( path ) ;
@@ -351,7 +348,6 @@ public void CanAddLockedWorktree_WithCommitedChanges()
351
348
Assert . Equal ( 3 , repo . Worktrees . Count ( ) ) ;
352
349
353
350
// 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)
355
351
Assert . False ( repo . RetrieveStatus ( ) . IsDirty ) ;
356
352
var filesInMain = GetFilesOfRepo ( repoPath ) ;
357
353
var filesInBranch = GetFilesOfRepo ( path ) ;
@@ -380,7 +376,6 @@ public void CanAddWorktreeForCommittish()
380
376
Assert . Equal ( 3 , repo . Worktrees . Count ( ) ) ;
381
377
382
378
// 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)
384
379
var filesInCommittish = new string [ ] { "numbers.txt" , "super-file.txt" } ;
385
380
var filesInBranch = GetFilesOfRepo ( path ) ;
386
381
Assert . Equal ( filesInCommittish , filesInBranch ) ;
@@ -390,9 +385,9 @@ public void CanAddWorktreeForCommittish()
390
385
private static IEnumerable < string > GetFilesOfRepo ( string repoPath )
391
386
{
392
387
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 )
396
391
. ToList ( ) ;
397
392
}
398
393
}
0 commit comments