diff --git a/src/ViewModels/ExecuteCustomAction.cs b/src/ViewModels/ExecuteCustomAction.cs index e8893f5a..920b9f43 100644 --- a/src/ViewModels/ExecuteCustomAction.cs +++ b/src/ViewModels/ExecuteCustomAction.cs @@ -10,12 +10,12 @@ namespace SourceGit.ViewModels private set; } - public ExecuteCustomAction(Repository repo, Models.CustomAction action, string sha) + public ExecuteCustomAction(Repository repo, Models.CustomAction action, Models.Commit commit) { _repo = repo; _args = action.Arguments.Replace("${REPO}", _repo.FullPath); - if (!string.IsNullOrEmpty(sha)) - _args = _args.Replace("${SHA}", sha); + if (commit != null) + _args = _args.Replace("${SHA}", commit.SHA); CustomAction = action; View = new Views.ExecuteCustomAction() { DataContext = this }; diff --git a/src/ViewModels/Histories.cs b/src/ViewModels/Histories.cs index fc973948..713e1635 100644 --- a/src/ViewModels/Histories.cs +++ b/src/ViewModels/Histories.cs @@ -626,7 +626,7 @@ namespace SourceGit.ViewModels item.Click += (_, e) => { if (PopupHost.CanCreatePopup()) - PopupHost.ShowAndStartPopup(new ExecuteCustomAction(_repo, action, commit.SHA)); + PopupHost.ShowAndStartPopup(new ExecuteCustomAction(_repo, dup, commit)); e.Handled = true; }; diff --git a/src/ViewModels/Repository.cs b/src/ViewModels/Repository.cs index ae24d5ef..9dd5ab9d 100644 --- a/src/ViewModels/Repository.cs +++ b/src/ViewModels/Repository.cs @@ -1310,7 +1310,7 @@ namespace SourceGit.ViewModels item.Click += (_, e) => { if (PopupHost.CanCreatePopup()) - PopupHost.ShowAndStartPopup(new ExecuteCustomAction(this, action, null)); + PopupHost.ShowAndStartPopup(new ExecuteCustomAction(this, dup, null)); e.Handled = true; };