using System.Diagnostics; using System.Globalization; namespace Octokit { /// /// Used to merge branches in a repository. /// /// /// /// The Repo Merging API supports merging branches in a repository. This accomplishes essentially the same thing /// as merging one branch into another in a local repository and then pushing to GitHub. The benefit is that the /// merge is done on the server side and a local repository is not needed. This makes it more appropriate for /// automation and other tools where maintaining local repositories would be cumbersome and inefficient. /// /// API: https://developer.github.com/v3/repos/merging/ /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class NewMerge { /// /// Create a new commit which has multiple parents (i.e. a merge commit) /// /// The name of the base branch that the head will be merged into /// The head to merge. This can be a branch name or a commit SHA1. public NewMerge(string @base, string head) { Ensure.ArgumentNotNullOrEmptyString(@base, nameof(@base)); Ensure.ArgumentNotNullOrEmptyString(head, nameof(head)); Base = @base; Head = head; } /// /// Gets or sets the commit message. /// /// /// The commit message. /// public string CommitMessage { get; set; } /// /// The name of the base branch that the head will be merged into (REQUIRED). /// /// /// The base. /// public string Base { get; private set; } /// /// The head to merge. This can be a branch name or a commit SHA1 (REQUIRED). /// /// /// The head. /// public string Head { get; private set; } internal string DebuggerDisplay { get { return string.Format(CultureInfo.InvariantCulture, "Message: {0}", CommitMessage); } } } }