mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-23 20:47:25 -08:00
fix<InteractiveRebase>: root commit can NOT be rebased
This commit is contained in:
parent
76e6719441
commit
84b2b4d7ae
1 changed files with 4 additions and 3 deletions
|
@ -135,7 +135,8 @@ namespace SourceGit.UI {
|
||||||
public InteractiveRebase(Git.Repository opened, Git.Commit start) {
|
public InteractiveRebase(Git.Repository opened, Git.Commit start) {
|
||||||
repo = opened;
|
repo = opened;
|
||||||
Items = new ObservableCollection<InteractiveRebaseItem>();
|
Items = new ObservableCollection<InteractiveRebaseItem>();
|
||||||
from = start.ShortSHA;
|
from = $"{start.ShortSHA}^";
|
||||||
|
if (start.Parents.Count == 0) from = start.ShortSHA;
|
||||||
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
|
@ -144,7 +145,7 @@ namespace SourceGit.UI {
|
||||||
|
|
||||||
Task.Run(() => {
|
Task.Run(() => {
|
||||||
var commits = repo.Commits($"{start.SHA}..HEAD");
|
var commits = repo.Commits($"{start.SHA}..HEAD");
|
||||||
commits.Add(start);
|
if (start.Parents.Count > 0) commits.Add(start);
|
||||||
|
|
||||||
Dispatcher.Invoke(() => {
|
Dispatcher.Invoke(() => {
|
||||||
Items.Clear();
|
Items.Clear();
|
||||||
|
@ -290,7 +291,7 @@ namespace SourceGit.UI {
|
||||||
|
|
||||||
repo.SetWatcherEnabled(false);
|
repo.SetWatcherEnabled(false);
|
||||||
var editor = Process.GetCurrentProcess().MainModule.FileName;
|
var editor = Process.GetCurrentProcess().MainModule.FileName;
|
||||||
var errs = repo.RunCommand($"-c sequence.editor=\"\\\"{editor}\\\" --interactive-rebase \\\"{temp}\\\"\" rebase -i {from}^", null);
|
var errs = repo.RunCommand($"-c sequence.editor=\"\\\"{editor}\\\" --interactive-rebase \\\"{temp}\\\"\" rebase -i {from}", null);
|
||||||
repo.AssertCommand(errs);
|
repo.AssertCommand(errs);
|
||||||
|
|
||||||
Close();
|
Close();
|
||||||
|
|
Loading…
Reference in a new issue