refactor: pass Models.Commit instead of just sha of it
Some checks are pending
Continuous Integration / Build (push) Waiting to run
Continuous Integration / Prepare version string (push) Waiting to run
Continuous Integration / Package (push) Blocked by required conditions
Localization Check / localization-check (push) Waiting to run

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2024-11-01 18:10:22 +08:00
parent ba3c72585d
commit 2f9e825b63
No known key found for this signature in database
3 changed files with 5 additions and 5 deletions

View file

@ -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 };

View file

@ -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;
};

View file

@ -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;
};