mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-11-06 13:00:59 -04:00
Keep the conflicts popup open after moving a patch into a new commit
If moving a custom patch into a new commit stops at a conflict, CheckMergeOrRebase shows the "Conflicts!" popup. The handler then focused the commits view anyway, and this closed the popup. Only focus the commits view if the operation finished. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
3864ddc52c
commit
fabc14d7e5
@@ -199,15 +199,21 @@ func (self *CustomPatchOptionsMenuAction) pullPatchIntoNewCommit(beforeOriginalC
|
||||
self.c.Helpers().Commits.CloseCommitMessagePanel()
|
||||
return self.c.WithWaitingStatus(self.c.Tr.RebasingStatus, func(gocui.Task) error {
|
||||
self.c.LogAction(self.c.Tr.Actions.MovePatchIntoNewCommit)
|
||||
var err error
|
||||
var result error
|
||||
if beforeOriginalCommit {
|
||||
err = self.c.Git().Patch.PullPatchIntoNewCommitBefore(commits, commitIndex, summary, description)
|
||||
result = self.c.Git().Patch.PullPatchIntoNewCommitBefore(commits, commitIndex, summary, description)
|
||||
} else {
|
||||
err = self.c.Git().Patch.PullPatchIntoNewCommit(commits, commitIndex, summary, description)
|
||||
result = self.c.Git().Patch.PullPatchIntoNewCommit(commits, commitIndex, summary, description)
|
||||
}
|
||||
if err := self.c.Helpers().MergeAndRebase.CheckMergeOrRebase(err); err != nil {
|
||||
if err := self.c.Helpers().MergeAndRebase.CheckMergeOrRebase(result); err != nil {
|
||||
return err
|
||||
}
|
||||
// If the rebase stopped at conflicts, CheckMergeOrRebase has asked the
|
||||
// user how to handle them; focusing the commits view would close that
|
||||
// popup.
|
||||
if result != nil {
|
||||
return nil
|
||||
}
|
||||
self.c.OnUIThread(func() error {
|
||||
self.c.Context().Push(self.c.Contexts().LocalCommits, types.OnFocusOpts{})
|
||||
return nil
|
||||
|
||||
@@ -47,7 +47,6 @@ var MovePatchToNewCommitBeforeWithConflict = NewIntegrationTest(NewIntegrationTe
|
||||
InitialText(Equals("")).
|
||||
Type("new commit").Confirm()
|
||||
|
||||
/* EXPECTED:
|
||||
t.Common().AcknowledgeConflicts()
|
||||
|
||||
t.Views().Files().
|
||||
@@ -55,15 +54,5 @@ var MovePatchToNewCommitBeforeWithConflict = NewIntegrationTest(NewIntegrationTe
|
||||
Lines(
|
||||
Contains("UU").Contains("file1"),
|
||||
)
|
||||
ACTUAL: */
|
||||
t.Views().Commits().
|
||||
IsFocused().
|
||||
Lines(
|
||||
Contains("─── Pending rebase todos"),
|
||||
Contains("pick").Contains("<-- CONFLICT --- commit to move from"),
|
||||
Contains("─── Commits"),
|
||||
Contains("new commit"),
|
||||
Contains("first commit"),
|
||||
)
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user