-
Notifications
You must be signed in to change notification settings - Fork 892
/
Copy pathRevertResult.cs
57 lines (51 loc) · 1.49 KB
/
RevertResult.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
52
53
54
55
56
57
namespace LibGit2Sharp
{
/// <summary>
/// Class to report the result of a revert.
/// </summary>
public class RevertResult
{
/// <summary>
/// Needed for mocking purposes.
/// </summary>
protected RevertResult()
{ }
internal RevertResult(RevertStatus status, Commit commit = null)
{
Commit = commit;
Status = status;
}
/// <summary>
/// The resulting commit of the revert.
/// <para>
/// This will return <code>null</code> if the revert was not committed.
/// This can happen if:
/// 1) The revert resulted in conflicts.
/// 2) The option to not commit on success is set.
/// </para>
/// </summary>
public virtual Commit Commit { get; private set; }
/// <summary>
/// The status of the revert.
/// </summary>
public virtual RevertStatus Status { get; private set; }
}
/// <summary>
/// The status of what happened as a result of a revert.
/// </summary>
public enum RevertStatus
{
/// <summary>
/// The commit was successfully reverted.
/// </summary>
Reverted,
/// <summary>
/// The revert resulted in conflicts.
/// </summary>
Conflicts,
/// <summary>
/// Revert was run, but there were no changes to commit.
/// </summary>
NothingToRevert,
}
}