Welcome to mirror list, hosted at ThFree Co, Russian Federation.

ReflogEntry.cs « LibGit2Sharp - github.com/mono/libgit2sharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: def2e0b3e44205c99a2f91b7d1ede7aa94ce1f98 (plain)
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
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; }
        }
    }
}