Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dff5d04

Browse files
authored
Merge pull request #4 from itofinity/mminns/issue-1471-worktrees
update fork
2 parents 1ba127b + 222d4c4 commit dff5d04

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

LibGit2Sharp.Tests/WorktreeFixture.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,12 @@ public void CanPruneDeletedWorktree()
167167
var worktreeUnlocked = repo.Worktrees["i-do-numbers"];
168168
Assert.Equal("i-do-numbers", worktreeUnlocked.Name);
169169
Assert.False(worktreeUnlocked.IsLocked);
170-
var info = worktreeUnlocked.WorktreeRepository.Info;
170+
using (var wtRepo = worktreeUnlocked.WorktreeRepository)
171+
{
172+
var info = wtRepo.Info;
171173

172-
Directory.Delete(info.WorkingDirectory, true);
174+
Directory.Delete(info.WorkingDirectory, true);
175+
}
173176

174177
Assert.True(repo.Worktrees.Prune(worktreeUnlocked));
175178

LibGit2Sharp/WorktreeLock.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,38 @@
66

77
namespace LibGit2Sharp
88
{
9+
/// <summary>
10+
/// Represents the lock state of a Worktree
11+
/// </summary>
912
[DebuggerDisplay("{DebuggerDisplay,nq}")]
1013
public class WorktreeLock
1114
{
15+
/// <summary>
16+
/// Creates a new instance of <see cref="WorktreeLock"/> with default, unlocked, state
17+
/// </summary>
1218
public WorktreeLock() : this(false, null)
1319
{
1420

1521
}
1622

23+
/// <summary>
24+
/// Creates a new instance of <see cref="WorktreeLock"/>
25+
/// </summary>
26+
/// <param name="isLocked">the locked state</param>
27+
/// <param name="reason">the reason given for the lock</param>
1728
public WorktreeLock(bool isLocked, string reason)
1829
{
1930
IsLocked = isLocked;
2031
Reason = reason;
2132
}
33+
/// <summary>
34+
/// Gets a flag indicating if the worktree is locked
35+
/// </summary>
2236
public virtual bool IsLocked { get; }
37+
38+
/// <summary>
39+
/// Gets the reason, if set, for the lock
40+
/// </summary>
2341
public virtual string Reason { get; }
2442

2543
private string DebuggerDisplay

0 commit comments

Comments
 (0)