mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2025-01-11 23:57:21 -08:00
refactor: pass Models.Commit instead of just sha of it
Some checks are pending
Some checks are pending
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
ba3c72585d
commit
2f9e825b63
3 changed files with 5 additions and 5 deletions
|
@ -10,12 +10,12 @@ namespace SourceGit.ViewModels
|
||||||
private set;
|
private set;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ExecuteCustomAction(Repository repo, Models.CustomAction action, string sha)
|
public ExecuteCustomAction(Repository repo, Models.CustomAction action, Models.Commit commit)
|
||||||
{
|
{
|
||||||
_repo = repo;
|
_repo = repo;
|
||||||
_args = action.Arguments.Replace("${REPO}", _repo.FullPath);
|
_args = action.Arguments.Replace("${REPO}", _repo.FullPath);
|
||||||
if (!string.IsNullOrEmpty(sha))
|
if (commit != null)
|
||||||
_args = _args.Replace("${SHA}", sha);
|
_args = _args.Replace("${SHA}", commit.SHA);
|
||||||
|
|
||||||
CustomAction = action;
|
CustomAction = action;
|
||||||
View = new Views.ExecuteCustomAction() { DataContext = this };
|
View = new Views.ExecuteCustomAction() { DataContext = this };
|
||||||
|
|
|
@ -626,7 +626,7 @@ namespace SourceGit.ViewModels
|
||||||
item.Click += (_, e) =>
|
item.Click += (_, e) =>
|
||||||
{
|
{
|
||||||
if (PopupHost.CanCreatePopup())
|
if (PopupHost.CanCreatePopup())
|
||||||
PopupHost.ShowAndStartPopup(new ExecuteCustomAction(_repo, action, commit.SHA));
|
PopupHost.ShowAndStartPopup(new ExecuteCustomAction(_repo, dup, commit));
|
||||||
|
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1310,7 +1310,7 @@ namespace SourceGit.ViewModels
|
||||||
item.Click += (_, e) =>
|
item.Click += (_, e) =>
|
||||||
{
|
{
|
||||||
if (PopupHost.CanCreatePopup())
|
if (PopupHost.CanCreatePopup())
|
||||||
PopupHost.ShowAndStartPopup(new ExecuteCustomAction(this, action, null));
|
PopupHost.ShowAndStartPopup(new ExecuteCustomAction(this, dup, null));
|
||||||
|
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue