diff --git a/src/Commands/ExecuteCustomAction.cs b/src/Commands/ExecuteCustomAction.cs index e59bc068..000c8fd1 100644 --- a/src/Commands/ExecuteCustomAction.cs +++ b/src/Commands/ExecuteCustomAction.cs @@ -27,7 +27,7 @@ namespace SourceGit.Commands } } - public static void RunAndWait(string repo, string file, string args, Models.ICommandLog log) + public static void RunAndWait(string repo, string file, string args, Action outputHandler) { var start = new ProcessStartInfo(); start.FileName = file; @@ -40,22 +40,20 @@ namespace SourceGit.Commands start.StandardErrorEncoding = Encoding.UTF8; start.WorkingDirectory = repo; - log?.AppendLine($"$ {file} {args}\n"); - var proc = new Process() { StartInfo = start }; var builder = new StringBuilder(); proc.OutputDataReceived += (_, e) => { if (e.Data != null) - log?.AppendLine(e.Data); + outputHandler?.Invoke(e.Data); }; proc.ErrorDataReceived += (_, e) => { if (e.Data != null) { - log?.AppendLine(e.Data); + outputHandler?.Invoke(e.Data); builder.AppendLine(e.Data); } }; diff --git a/src/Models/RepositorySettings.cs b/src/Models/RepositorySettings.cs index 42db3bb6..9af032bb 100644 --- a/src/Models/RepositorySettings.cs +++ b/src/Models/RepositorySettings.cs @@ -417,7 +417,6 @@ namespace SourceGit.Models public void PushCommitMessage(string message) { - message = message.Trim().ReplaceLineEndings("\n"); var existIdx = CommitMessages.IndexOf(message); if (existIdx == 0) return; diff --git a/src/ViewModels/ExecuteCustomAction.cs b/src/ViewModels/ExecuteCustomAction.cs index 30345d99..52729e56 100644 --- a/src/ViewModels/ExecuteCustomAction.cs +++ b/src/ViewModels/ExecuteCustomAction.cs @@ -36,16 +36,13 @@ namespace SourceGit.ViewModels _repo.SetWatcherEnabled(false); ProgressDescription = "Run custom action ..."; - var log = _repo.CreateLog(CustomAction.Name); - return Task.Run(() => { if (CustomAction.WaitForExit) - Commands.ExecuteCustomAction.RunAndWait(_repo.FullPath, CustomAction.Executable, _args, log); + Commands.ExecuteCustomAction.RunAndWait(_repo.FullPath, CustomAction.Executable, _args, output => CallUIThread(() => ProgressDescription = output)); else Commands.ExecuteCustomAction.Run(_repo.FullPath, CustomAction.Executable, _args); - log.Complete(); CallUIThread(() => _repo.SetWatcherEnabled(true)); return true; });