sourcegit/src/Commands/CherryPick.cs
leo 5fef6e93b9
enhance: cherry-pick (#563)
* supports to cherry-pick a merge commit
* add option to enable the `-x` parameter
2024-10-14 15:20:02 +08:00

20 lines
576 B
C#

namespace SourceGit.Commands
{
public class CherryPick : Command
{
public CherryPick(string repo, string commits, bool noCommit, bool appendSourceToMessage, string extraParams)
{
WorkingDirectory = repo;
Context = repo;
Args = "cherry-pick ";
if (noCommit)
Args += "-n ";
if (appendSourceToMessage)
Args += "-x ";
if (!string.IsNullOrEmpty(extraParams))
Args += $"{extraParams} ";
Args += commits;
}
}
}