-
Notifications
You must be signed in to change notification settings - Fork 892
/
Copy pathMergeHead.cs
36 lines (32 loc) · 1 KB
/
MergeHead.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
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;
}
}
}