/// <summary> /// Rewrite some of the commits in the repository and all the references that can reach them. /// </summary> /// <param name="options">Specifies behavior for this rewrite.</param> /// <param name="commitsToRewrite">The <see cref="Commit"/> objects to rewrite.</param> public virtual void RewriteHistory(RewriteHistoryOptions options, IEnumerable <Commit> commitsToRewrite) { Ensure.ArgumentNotNull(commitsToRewrite, "commitsToRewrite"); Ensure.ArgumentNotNull(options, "options"); Ensure.ArgumentNotNullOrEmptyString(options.BackupRefsNamespace, "options.BackupRefsNamespace"); IList <Reference> originalRefs = this.ToList(); if (originalRefs.Count == 0) { // Nothing to do return; } var historyRewriter = new HistoryRewriter(repo, commitsToRewrite, options); historyRewriter.Execute(); }
/// <summary> /// Rewrite some of the commits in the repository and all the references that can reach them. /// </summary> /// <param name="options">Specifies behavior for this rewrite.</param> /// <param name="commitsToRewrite">The <see cref="Commit"/> objects to rewrite.</param> public virtual void RewriteHistory(RewriteHistoryOptions options, params Commit[] commitsToRewrite) { Ensure.ArgumentNotNull(commitsToRewrite, "commitsToRewrite"); RewriteHistory(options, commitsToRewrite.AsEnumerable()); }