Skip to content

Commit 2f9e825

Browse files
committed
refactor: pass Models.Commit instead of just sha of it
Signed-off-by: leo <[email protected]>
1 parent ba3c725 commit 2f9e825

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/ViewModels/ExecuteCustomAction.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ public Models.CustomAction CustomAction
1010
private set;
1111
}
1212

13-
public ExecuteCustomAction(Repository repo, Models.CustomAction action, string sha)
13+
public ExecuteCustomAction(Repository repo, Models.CustomAction action, Models.Commit commit)
1414
{
1515
_repo = repo;
1616
_args = action.Arguments.Replace("${REPO}", _repo.FullPath);
17-
if (!string.IsNullOrEmpty(sha))
18-
_args = _args.Replace("${SHA}", sha);
17+
if (commit != null)
18+
_args = _args.Replace("${SHA}", commit.SHA);
1919

2020
CustomAction = action;
2121
View = new Views.ExecuteCustomAction() { DataContext = this };

src/ViewModels/Histories.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ public ContextMenu MakeContextMenu(ListBox list)
626626
item.Click += (_, e) =>
627627
{
628628
if (PopupHost.CanCreatePopup())
629-
PopupHost.ShowAndStartPopup(new ExecuteCustomAction(_repo, action, commit.SHA));
629+
PopupHost.ShowAndStartPopup(new ExecuteCustomAction(_repo, dup, commit));
630630

631631
e.Handled = true;
632632
};

src/ViewModels/Repository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1310,7 +1310,7 @@ public ContextMenu CreateContextMenuForCustomAction()
13101310
item.Click += (_, e) =>
13111311
{
13121312
if (PopupHost.CanCreatePopup())
1313-
PopupHost.ShowAndStartPopup(new ExecuteCustomAction(this, action, null));
1313+
PopupHost.ShowAndStartPopup(new ExecuteCustomAction(this, dup, null));
13141314

13151315
e.Handled = true;
13161316
};

0 commit comments

Comments
 (0)