pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/libgit2/libgit2sharp/commit/f145a2c276fefb10d3e20ab92bd398f4251f0b8f

ssorigen="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/global-9c8f61f9f58ad7b2.css" /> Tweaks · libgit2/libgit2sharp@f145a2c · GitHub
Skip to content

Commit f145a2c

Browse files
committed
Tweaks
1 parent 08fafd5 commit f145a2c

2 files changed

Lines changed: 10 additions & 14 deletions

File tree

LibGit2Sharp.Tests/WorktreeFixture.cs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
using LibGit2Sharp.Tests.TestHelpers;
2-
using System;
1+
using System;
32
using System.Collections.Generic;
43
using System.IO;
54
using System.Linq;
5+
using LibGit2Sharp.Tests.TestHelpers;
66
using Xunit;
77

88
namespace 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,10 +288,10 @@ 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);
294+
296295
Assert.Equal(filesInMain, filesInBranch);
297296
}
298297
}
@@ -314,7 +313,6 @@ public void CanAddLockedWorktree_WithUncommitedChanges()
314313
Assert.Equal(3, repo.Worktrees.Count());
315314

316315
// 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)
318316
Assert.True(repo.RetrieveStatus().IsDirty);
319317
var filesInMain = GetFilesOfRepo(repoPath);
320318
var filesInBranch = GetFilesOfRepo(path);
@@ -351,7 +349,6 @@ public void CanAddLockedWorktree_WithCommitedChanges()
351349
Assert.Equal(3, repo.Worktrees.Count());
352350

353351
// 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)
355352
Assert.False(repo.RetrieveStatus().IsDirty);
356353
var filesInMain = GetFilesOfRepo(repoPath);
357354
var filesInBranch = GetFilesOfRepo(path);
@@ -380,7 +377,6 @@ public void CanAddWorktreeForCommittish()
380377
Assert.Equal(3, repo.Worktrees.Count());
381378

382379
// 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)
384380
var filesInCommittish = new string[] { "numbers.txt", "super-file.txt" };
385381
var filesInBranch = GetFilesOfRepo(path);
386382
Assert.Equal(filesInCommittish, filesInBranch);
@@ -390,9 +386,9 @@ public void CanAddWorktreeForCommittish()
390386
private static IEnumerable<string> GetFilesOfRepo(string repoPath)
391387
{
392388
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)
396392
.ToList();
397393
}
398394
}

LibGit2Sharp/WorktreeCollection.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ public virtual Worktree this[string name]
4646
}
4747

4848
//github.com/ <summary>
49-
//github.com/
49+
//github.com/ Creates a worktree.
5050
//github.com/ </summary>
51-
//github.com/ <param name="committishOrBranchSpec">A committish or branch name./param>
51+
//github.com/ <param name="committishOrBranchSpec">The committish to checkout into the new worktree.</param>
5252
//github.com/ <param name="name">Name of the worktree.</param>
5353
//github.com/ <param name="path">Location of the worktree.</param>
5454
//github.com/ <param name="isLocked"></param>
@@ -84,11 +84,11 @@ public virtual Worktree Add(string committishOrBranchSpec, string name, string p
8484
}
8585

8686
//github.com/ <summary>
87-
//github.com/
87+
//github.com/ Creates a worktree.
8888
//github.com/ </summary>
89-
//github.com/ <param name="committishOrBranchSpec">A committish or branch name./param>
9089
//github.com/ <param name="name">Name of the worktree.</param>
9190
//github.com/ <param name="path">Location of the worktree.</param>
91+
//github.com/ <param name="isLocked"></param>
9292
public virtual Worktree Add(string name, string path, bool isLocked)
9393
{
9494
var options = new git_worktree_add_options

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy