-
Notifications
You must be signed in to change notification settings - Fork 892
/
Copy pathReflogEntry.cs
68 lines (61 loc) · 2.08 KB
/
ReflogEntry.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
58
59
60
61
62
63
64
65
66
67
68
using System;
using System.Runtime.InteropServices;
using LibGit2Sharp.Core;
namespace LibGit2Sharp
{
/// <summary>
/// As single entry of a <see cref="ReflogCollection"/>
/// a <see cref="ReflogEntry"/> describes one single update on a particular reference
/// </summary>
public class ReflogEntry
{
private readonly ObjectId _from;
private readonly ObjectId _to;
private readonly Signature _committer;
private readonly string message;
/// <summary>
/// Needed for mocking purposes.
/// </summary>
protected ReflogEntry()
{ }
/// <summary>
/// Initializes a new instance of the <see cref="ReflogEntry"/> class.
/// </summary>
/// <param name="entryHandle">a <see cref="SafeHandle"/> to the reflog entry</param>
internal unsafe ReflogEntry(git_reflog_entry* entryHandle)
{
_from = Proxy.git_reflog_entry_id_old(entryHandle);
_to = Proxy.git_reflog_entry_id_new(entryHandle);
_committer = Proxy.git_reflog_entry_committer(entryHandle);
message = Proxy.git_reflog_entry_message(entryHandle);
}
/// <summary>
/// <see cref="ObjectId"/> targeted before the reference update described by this <see cref="ReflogEntry"/>
/// </summary>
public virtual ObjectId From
{
get { return _from; }
}
/// <summary>
/// <see cref="ObjectId"/> targeted after the reference update described by this <see cref="ReflogEntry"/>
/// </summary>
public virtual ObjectId To
{
get { return _to; }
}
/// <summary>
/// <see cref="Signature"/> of the committer of this reference update
/// </summary>
public virtual Signature Committer
{
get { return _committer; }
}
/// <summary>
/// the message assiocated to this reference update
/// </summary>
public virtual string Message
{
get { return message; }
}
}
}