2024-06-20 02:02:12 -07:00
|
|
|
|
using System.Diagnostics;
|
|
|
|
|
|
|
|
|
|
namespace SourceGit.Commands
|
2024-03-17 18:37:06 -07:00
|
|
|
|
{
|
|
|
|
|
public class Rebase : Command
|
|
|
|
|
{
|
|
|
|
|
public Rebase(string repo, string basedOn, bool autoStash)
|
|
|
|
|
{
|
2024-02-05 23:08:37 -08:00
|
|
|
|
WorkingDirectory = repo;
|
|
|
|
|
Context = repo;
|
2021-04-29 05:05:55 -07:00
|
|
|
|
Args = "rebase ";
|
2024-03-31 01:54:29 -07:00
|
|
|
|
if (autoStash)
|
|
|
|
|
Args += "--autostash ";
|
2021-04-29 05:05:55 -07:00
|
|
|
|
Args += basedOn;
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-06-20 02:02:12 -07:00
|
|
|
|
|
|
|
|
|
public class InteractiveRebase : Command
|
|
|
|
|
{
|
|
|
|
|
public InteractiveRebase(string repo, string basedOn)
|
|
|
|
|
{
|
|
|
|
|
var exec = Process.GetCurrentProcess().MainModule.FileName;
|
|
|
|
|
var editor = $"\\\"{exec}\\\" --rebase-editor";
|
|
|
|
|
|
|
|
|
|
WorkingDirectory = repo;
|
|
|
|
|
Context = repo;
|
|
|
|
|
Args = $"-c core.editor=\"{editor}\" -c sequence.editor=\"{editor}\" -c rebase.abbreviateCommands=true rebase -i --autosquash {basedOn}";
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-03-31 01:54:29 -07:00
|
|
|
|
}
|