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

MergeHead.cs « LibGit2Sharp - github.com/mono/libgit2sharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2ad5081791fd5607216aed7387ce88f06bce5bc0 (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
using System.Globalization;

namespace LibGit2Sharp
{
    /// <summary>
    /// A merge head is a parent for the next commit.
    /// </summary>
    internal class MergeHead : ReferenceWrapper<Commit>
    {
        /// <summary>
        /// Needed for mocking purposes.
        /// </summary>
        protected MergeHead()
        { }

        internal MergeHead(Repository repo, ObjectId targetId, int index)
            : base(repo, new DirectReference(string.Format(CultureInfo.InvariantCulture, "MERGE_HEAD[{0}]", index), repo, targetId), r => r.CanonicalName)
        {
        }

        /// <summary>
        /// Gets the <see cref="Commit"/> that this merge head points to.
        /// </summary>
        public virtual Commit Tip
        {
            get { return TargetObject; }
        }

        /// <summary>
        /// Returns "MERGE_HEAD[i]", where i is the index of this merge head.
        /// </summary>
        protected override string Shorten()
        {
            return CanonicalName;
        }
    }
}