mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-21 22:43:27 +02:00
feat: focus on local commits view after moving code into new commit
This commit is contained in:
parent
a4e9181a6b
commit
5af0ea85fc
@ -217,7 +217,10 @@ func (self *CustomPatchOptionsMenuAction) handlePullPatchIntoNewCommit() error {
|
|||||||
_ = self.c.Helpers().Commits.PopCommitMessageContexts()
|
_ = self.c.Helpers().Commits.PopCommitMessageContexts()
|
||||||
self.c.LogAction(self.c.Tr.Actions.MovePatchIntoNewCommit)
|
self.c.LogAction(self.c.Tr.Actions.MovePatchIntoNewCommit)
|
||||||
err := self.c.Git().Patch.PullPatchIntoNewCommit(self.c.Model().Commits, commitIndex, summary, description)
|
err := self.c.Git().Patch.PullPatchIntoNewCommit(self.c.Model().Commits, commitIndex, summary, description)
|
||||||
return self.c.Helpers().MergeAndRebase.CheckMergeOrRebase(err)
|
if err := self.c.Helpers().MergeAndRebase.CheckMergeOrRebase(err); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return self.c.PushContext(self.c.Contexts().LocalCommits)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -51,6 +51,16 @@ var MoveToNewCommitPartialHunk = NewIntegrationTest(NewIntegrationTestArgs{
|
|||||||
InitialText(Equals("")).
|
InitialText(Equals("")).
|
||||||
Type("new commit").Confirm()
|
Type("new commit").Confirm()
|
||||||
|
|
||||||
|
t.Views().Commits().
|
||||||
|
IsFocused().
|
||||||
|
Lines(
|
||||||
|
Contains("third commit"),
|
||||||
|
Contains("new commit").IsSelected(),
|
||||||
|
Contains("commit to move from"),
|
||||||
|
Contains("first commit"),
|
||||||
|
).
|
||||||
|
PressEnter()
|
||||||
|
|
||||||
t.Views().CommitFiles().
|
t.Views().CommitFiles().
|
||||||
IsFocused().
|
IsFocused().
|
||||||
Lines(
|
Lines(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user