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,10 +288,10 @@ 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 ) ;
294
+
296
295
Assert . Equal ( filesInMain , filesInBranch ) ;
297
296
}
298
297
}
@@ -314,7 +313,6 @@ public void CanAddLockedWorktree_WithUncommitedChanges()
314
313
Assert . Equal ( 3 , repo . Worktrees . Count ( ) ) ;
315
314
316
315
// 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
316
Assert . True ( repo . RetrieveStatus ( ) . IsDirty ) ;
319
317
var filesInMain = GetFilesOfRepo ( repoPath ) ;
320
318
var filesInBranch = GetFilesOfRepo ( path ) ;
@@ -351,7 +349,6 @@ public void CanAddLockedWorktree_WithCommitedChanges()
351
349
Assert . Equal ( 3 , repo . Worktrees . Count ( ) ) ;
352
350
353
351
// 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
352
Assert . False ( repo . RetrieveStatus ( ) . IsDirty ) ;
356
353
var filesInMain = GetFilesOfRepo ( repoPath ) ;
357
354
var filesInBranch = GetFilesOfRepo ( path ) ;
@@ -380,7 +377,6 @@ public void CanAddWorktreeForCommittish()
380
377
Assert . Equal ( 3 , repo . Worktrees . Count ( ) ) ;
381
378
382
379
// 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
380
var filesInCommittish = new string [ ] { "numbers.txt" , "super-file.txt" } ;
385
381
var filesInBranch = GetFilesOfRepo ( path ) ;
386
382
Assert . Equal ( filesInCommittish , filesInBranch ) ;
@@ -390,9 +386,9 @@ public void CanAddWorktreeForCommittish()
390
386
private static IEnumerable < string > GetFilesOfRepo ( string repoPath )
391
387
{
392
388
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 )
389
+ . Where ( fileName => ! fileName . StartsWith ( Path . Combine ( repoPath , ".git" ) ) )
390
+ . Select ( fileName => fileName . Replace ( $ "{ repoPath } { Path . DirectorySeparatorChar } ", "" ) )
391
+ . OrderBy ( fileName => fileName )
396
392
. ToList ( ) ;
397
393
}
398
394
}
0 commit comments