diff --git a/src/Commands/Push.cs b/src/Commands/Push.cs index dc81f606..70d0e527 100644 --- a/src/Commands/Push.cs +++ b/src/Commands/Push.cs @@ -1,4 +1,7 @@ using System; +using System.Collections.Generic; + +using Avalonia.Threading; namespace SourceGit.Commands { @@ -39,11 +42,29 @@ namespace SourceGit.Commands Args += $"{remote} {refname}"; } + public new bool Exec() + { + if (!base.Exec()) + { + return false; + } + if (_remoteMessage.Count > 0) + { + Dispatcher.UIThread.Post(() => App.SendNotification(Context, string.Join("\n", _remoteMessage))); + } + return true; + } + protected override void OnReadline(string line) { + if (line.StartsWith("remote: ")) + { + _remoteMessage.Add(line.Substring(8)); + } _outputHandler?.Invoke(line); } private readonly Action _outputHandler = null; + private List _remoteMessage = new List(); } }