-
Notifications
You must be signed in to change notification settings - Fork 892
/
Copy pathWorktreeLock.cs
51 lines (46 loc) · 1.4 KB
/
WorktreeLock.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Text;
namespace LibGit2Sharp
{
/// <summary>
/// Represents the lock state of a Worktree
/// </summary>
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class WorktreeLock
{
/// <summary>
/// Creates a new instance of <see cref="WorktreeLock"/> with default, unlocked, state
/// </summary>
public WorktreeLock() : this(false, null)
{
}
/// <summary>
/// Creates a new instance of <see cref="WorktreeLock"/>
/// </summary>
/// <param name="isLocked">the locked state</param>
/// <param name="reason">the reason given for the lock</param>
public WorktreeLock(bool isLocked, string reason)
{
IsLocked = isLocked;
Reason = reason;
}
/// <summary>
/// Gets a flag indicating if the worktree is locked
/// </summary>
public virtual bool IsLocked { get; }
/// <summary>
/// Gets the reason, if set, for the lock
/// </summary>
public virtual string Reason { get; }
private string DebuggerDisplay
{
get
{
return string.Format(CultureInfo.InvariantCulture, "{0} => {1}", IsLocked, Reason);
}
}
}
}