mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 12:45:00 +00:00
enhance: cherry-pick (#563)
* supports to cherry-pick a merge commit * add option to enable the `-x` parameter
This commit is contained in:
parent
688f10e02f
commit
5fef6e93b9
7 changed files with 144 additions and 19 deletions
|
@ -2,12 +2,19 @@
|
|||
{
|
||||
public class CherryPick : Command
|
||||
{
|
||||
public CherryPick(string repo, string commits, bool noCommit)
|
||||
public CherryPick(string repo, string commits, bool noCommit, bool appendSourceToMessage, string extraParams)
|
||||
{
|
||||
var mode = noCommit ? "-n" : "--ff";
|
||||
WorkingDirectory = repo;
|
||||
Context = repo;
|
||||
Args = $"cherry-pick {mode} {commits}";
|
||||
|
||||
Args = "cherry-pick ";
|
||||
if (noCommit)
|
||||
Args += "-n ";
|
||||
if (appendSourceToMessage)
|
||||
Args += "-x ";
|
||||
if (!string.IsNullOrEmpty(extraParams))
|
||||
Args += $"{extraParams} ";
|
||||
Args += commits;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue