public static MergeResult Execute(MergeOptions options) { options.Validate(); var merger = SelectMerger(options); bool success = merger.Merge(options.Commits.Select(c => ((Core.Commit)c).CommitId).ToArray()); var result = new MergeResult { Success = success }; result.Tree = new Tree(options.Repository, merger.GetResultTreeId()); if (options.NoCommit) { } else { if (string.IsNullOrEmpty(options.Message)) { options.Message = FormatMergeMessage(options); } var author = Author.GetDefaultAuthor(options.Repository); result.Commit = Commit.Create(options.Message, options.Commits, result.Tree, author, author, DateTimeOffset.Now); if (options.Branches.Length >= 1 && options.Branches[0] is Branch) { Ref.Update("refs/heads/" + options.Branches[0].Name, result.Commit); } } return(result); }
public static MergeResult Execute(MergeOptions options) { options.Validate(); var merger = SelectMerger(options); bool success = merger.Merge(options.Commits.Select(c => ((Core.Commit)c).CommitId).ToArray()); var result = new MergeResult { Success = success }; result.Tree = new Tree(options.Repository, merger.GetResultTreeId()); if (options.NoCommit) { } else { if (string.IsNullOrEmpty(options.Message)) { options.Message = FormatMergeMessage(options); } var author = Author.GetDefaultAuthor(options.Repository); result.Commit = Commit.Create(options.Message, options.Commits, result.Tree, author, author, DateTimeOffset.Now); if (options.Branches.Length >= 1 && options.Branches[0] is Branch) Ref.Update("refs/heads/" + options.Branches[0].Name, result.Commit); } return result; }