diff options
author | Metalrom <romain.magny@gmail.com> | 2013-03-28 14:48:01 +0400 |
---|---|---|
committer | Metalrom <romain.magny@gmail.com> | 2013-04-10 20:42:59 +0400 |
commit | 030089bcb1176c5df60fc612fc12777f2a71e884 (patch) | |
tree | 3d9b6470684b0033ba238f9b9a1f164038a3a9d4 /LibGit2Sharp/ReflogEntry.cs | |
parent | 3818634bf425d5c6c8e4894bbc1e9eb11b9f0533 (diff) |
Introduce Repository.Refs.Log()
returns the reflog of the reference given as parameter
Diffstat (limited to 'LibGit2Sharp/ReflogEntry.cs')
-rw-r--r-- | LibGit2Sharp/ReflogEntry.cs | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/LibGit2Sharp/ReflogEntry.cs b/LibGit2Sharp/ReflogEntry.cs new file mode 100644 index 00000000..d9f53170 --- /dev/null +++ b/LibGit2Sharp/ReflogEntry.cs @@ -0,0 +1,67 @@ +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 _commiter; + 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> + public ReflogEntry(SafeHandle entryHandle) + { + _from = Proxy.git_reflog_entry_id_old(entryHandle); + _to = Proxy.git_reflog_entry_id_new(entryHandle); + _commiter = 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 commiter of this reference update + /// </summary> + public virtual Signature Commiter + { + get { return _commiter; } + } + + /// <summary> + /// the message assiocated to this reference update + /// </summary> + public virtual string Message + { + get { return message; } + } + } +} |