refactor: commandline parsing

* `--rebase-todo-editor` launches this app as a git `sequence.editor`
* `--rebase-message-editor` launches this app as a git `core.editor` which runs on background by reading rebasing jobs
* `--core-editor` launches this app as a git `core.editor`
* `--askpass` launches this app as a SSH askpass program
This commit is contained in:
leo 2024-07-09 10:16:15 +08:00
parent cbe4c36525
commit 6930b51c64
No known key found for this signature in database
14 changed files with 320 additions and 155 deletions

View file

@ -1,5 +1,4 @@
using System.Diagnostics;
using System.IO;
using System.IO;
namespace SourceGit.ViewModels
{
@ -39,7 +38,8 @@ namespace SourceGit.ViewModels
{
WorkingDirectory = Repository,
Context = Repository,
Args = $"-c core.editor=true {Cmd} --continue",
Editor = Commands.Command.EditorType.None,
Args = $"{Cmd} --continue",
}.Exec();
}
}
@ -58,14 +58,12 @@ namespace SourceGit.ViewModels
public override bool Continue()
{
var exec = Process.GetCurrentProcess().MainModule.FileName;
var editor = $"\\\"{exec}\\\" --rebase-editor";
var succ = new Commands.Command()
{
WorkingDirectory = Repository,
Context = Repository,
Args = $"-c core.editor=\"{editor}\" rebase --continue",
Editor = Commands.Command.EditorType.RebaseEditor,
Args = $"rebase --continue",
}.Exec();
if (succ)