File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -167,9 +167,12 @@ public void CanPruneDeletedWorktree()
167
167
var worktreeUnlocked = repo . Worktrees [ "i-do-numbers" ] ;
168
168
Assert . Equal ( "i-do-numbers" , worktreeUnlocked . Name ) ;
169
169
Assert . False ( worktreeUnlocked . IsLocked ) ;
170
- var info = worktreeUnlocked . WorktreeRepository . Info ;
170
+ using ( var wtRepo = worktreeUnlocked . WorktreeRepository )
171
+ {
172
+ var info = wtRepo . Info ;
171
173
172
- Directory . Delete ( info . WorkingDirectory , true ) ;
174
+ Directory . Delete ( info . WorkingDirectory , true ) ;
175
+ }
173
176
174
177
Assert . True ( repo . Worktrees . Prune ( worktreeUnlocked ) ) ;
175
178
Original file line number Diff line number Diff line change 6
6
7
7
namespace LibGit2Sharp
8
8
{
9
+ /// <summary>
10
+ /// Represents the lock state of a Worktree
11
+ /// </summary>
9
12
[ DebuggerDisplay ( "{DebuggerDisplay,nq}" ) ]
10
13
public class WorktreeLock
11
14
{
15
+ /// <summary>
16
+ /// Creates a new instance of <see cref="WorktreeLock"/> with default, unlocked, state
17
+ /// </summary>
12
18
public WorktreeLock ( ) : this ( false , null )
13
19
{
14
20
15
21
}
16
22
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>
17
28
public WorktreeLock ( bool isLocked , string reason )
18
29
{
19
30
IsLocked = isLocked ;
20
31
Reason = reason ;
21
32
}
33
+ /// <summary>
34
+ /// Gets a flag indicating if the worktree is locked
35
+ /// </summary>
22
36
public virtual bool IsLocked { get ; }
37
+
38
+ /// <summary>
39
+ /// Gets the reason, if set, for the lock
40
+ /// </summary>
23
41
public virtual string Reason { get ; }
24
42
25
43
private string DebuggerDisplay
You can’t perform that action at this time.
0 commit comments