using System;
using System.Collections.Generic;
namespace LibGit2Sharp
{
///
/// Options for a RewriteHistory operation.
///
public sealed class RewriteHistoryOptions
{
///
/// Initializes a new instance of the class.
///
public RewriteHistoryOptions()
{
BackupRefsNamespace = "refs/original/";
}
///
/// Namespace where rewritten references should be stored.
/// (required; default: "refs/original/")
///
public string BackupRefsNamespace { get; set; }
///
/// Rewriter for commit metadata.
///
public Func CommitHeaderRewriter { get; set; }
///
/// Rewriter for mangling parent links.
///
public Func> CommitParentsRewriter { get; set; }
///
/// Rewriter for commit trees.
///
public Func CommitTreeRewriter { get; set; }
///
/// Rewriter for tag names. This is called with
/// (OldTag.Name, OldTag.IsAnnotated, OldTarget.Identifier).
/// OldTarget.Identifier is either the SHA of a direct reference,
/// or the canonical name of a symbolic reference.
///
public Func TagNameRewriter { get; set; }
///
/// Empty commits should be removed while rewriting.
///
public bool PruneEmptyCommits { get; set; }
///
/// Action to exectute after rewrite succeeds,
/// but before it is finalized.
///
/// An exception thrown here will rollback the operation.
/// This is useful to inspect the new state of the repository
/// and throw if you need to adjust and try again.
///
///
public Action OnSucceeding { get; set; }
///
/// Action to execute if an error occurred during rewrite,
/// before rollback of rewrite progress.
/// Does not fire for exceptions thrown in .
///
/// This is useful to inspect the state of the repository
/// at the time of the exception for troubleshooting.
/// It is not meant to be used for general error handling;
/// for that use try
/catch
.
///
///
/// An exception thrown here will replace the original exception.
/// You may want to pass the callback exception as an innerException
.
///
///
public Action OnError { get; set; }
}
}