public VersionExportStep(VersionHistoryItem historyItem, int stepIndex, int totalNumberOfSteps, bool needsCleanWorkspace) : this() { HistoryItem = historyItem; NeedsCleanWorkspace = needsCleanWorkspace; Progress = Progress.ForStep(stepIndex, totalNumberOfSteps); }
string FormatCommitMessage(VersionHistoryItem historyItem) { var standardInputBuilder = new StringBuilder(); standardInputBuilder.AppendLine(historyItem.Comment); standardInputBuilder.AppendLine(); standardInputBuilder.AppendLine(FormatExportSourceNote(historyItem)); return(standardInputBuilder.ToString()); }
void CommitFiles(VersionHistoryItem historyItem) { context.Logger.LogInfo("Committing files to Git..."); string commitMessage = FormatCommitMessage(historyItem); string commitDate = FormatDateForCommit(historyItem.Date); string commitAuthor = FormatAuthorForCommit(historyItem.Author, context.Parameters.CommitAuthorEmailDomain); gitClient.ExecuteCommand(CommitCommand, commitMessage, new NamedArgument(MessageSourceFileArgument, UseStandardInputArgumentValue), new NamedArgument(AuthorArgument, commitAuthor), new NamedArgument(DateArgument, commitDate), new SwitchArgument(AllowEmptySwitchArgument)); }
string FormatExportSourceNote(VersionHistoryItem historyItem) { return(string.Format(VaultExportSourceNoteFormat, context.Parameters.VaultRepositoryPath, historyItem.Version)); }
public void Execute(VersionHistoryItem historyItem) { StageFiles(); CommitFiles(historyItem); }