mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 12:15:00 +00:00
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:
parent
cbe4c36525
commit
6930b51c64
14 changed files with 320 additions and 155 deletions
|
@ -168,18 +168,18 @@ namespace SourceGit.ViewModels
|
|||
_repo.SetWatcherEnabled(false);
|
||||
|
||||
var saveFile = Path.Combine(_repo.GitDir, "sourcegit_rebase_jobs.json");
|
||||
var jobs = new List<Models.InteractiveRebaseJob>();
|
||||
var collection = new Models.InteractiveRebaseJobCollection();
|
||||
for (int i = Items.Count - 1; i >= 0; i--)
|
||||
{
|
||||
var item = Items[i];
|
||||
jobs.Add(new Models.InteractiveRebaseJob()
|
||||
collection.Jobs.Add(new Models.InteractiveRebaseJob()
|
||||
{
|
||||
SHA = item.Commit.SHA,
|
||||
Action = item.Action,
|
||||
Message = item.FullMessage,
|
||||
});
|
||||
}
|
||||
File.WriteAllText(saveFile, JsonSerializer.Serialize(jobs, JsonCodeGen.Default.ListInteractiveRebaseJob));
|
||||
File.WriteAllText(saveFile, JsonSerializer.Serialize(collection, JsonCodeGen.Default.InteractiveRebaseJobCollection));
|
||||
|
||||
return Task.Run(() =>
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue