using System.Globalization;
namespace LibGit2Sharp
{
///
/// A merge head is a parent for the next commit.
///
internal class MergeHead : ReferenceWrapper
{
///
/// Needed for mocking purposes.
///
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)
{
}
///
/// Gets the that this merge head points to.
///
public virtual Commit Tip
{
get { return TargetObject; }
}
///
/// Returns "MERGE_HEAD[i]", where i is the index of this merge head.
///
protected override string Shorten()
{
return CanonicalName;
}
}
}