mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 04:34:59 +00:00
feature: support add custom actions for selected branch (#980)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
9b07034846
commit
9104060d79
7 changed files with 73 additions and 22 deletions
|
@ -10,13 +10,26 @@ namespace SourceGit.ViewModels
|
|||
private set;
|
||||
}
|
||||
|
||||
public ExecuteCustomAction(Repository repo, Models.CustomAction action, Models.Commit commit)
|
||||
public ExecuteCustomAction(Repository repo, Models.CustomAction action)
|
||||
{
|
||||
_repo = repo;
|
||||
_args = action.Arguments.Replace("${REPO}", _repo.FullPath);
|
||||
if (commit != null)
|
||||
_args = _args.Replace("${SHA}", commit.SHA);
|
||||
CustomAction = action;
|
||||
View = new Views.ExecuteCustomAction() { DataContext = this };
|
||||
}
|
||||
|
||||
public ExecuteCustomAction(Repository repo, Models.CustomAction action, Models.Branch branch)
|
||||
{
|
||||
_repo = repo;
|
||||
_args = action.Arguments.Replace("${REPO}", _repo.FullPath).Replace("${BRANCH}", branch.FriendlyName);
|
||||
CustomAction = action;
|
||||
View = new Views.ExecuteCustomAction() { DataContext = this };
|
||||
}
|
||||
|
||||
public ExecuteCustomAction(Repository repo, Models.CustomAction action, Models.Commit commit)
|
||||
{
|
||||
_repo = repo;
|
||||
_args = action.Arguments.Replace("${REPO}", _repo.FullPath).Replace("${SHA}", commit.SHA);
|
||||
CustomAction = action;
|
||||
View = new Views.ExecuteCustomAction() { DataContext = this };
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue