Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Focus on local commits view after moving code into new commit #3577

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat: focus on local commits view after moving code into new commit
  • Loading branch information
AzraelSec committed May 20, 2024
commit 5af0ea85fcfdd02d7ac72bc11b68e432a70bafdf
5 changes: 4 additions & 1 deletion pkg/gui/controllers/custom_patch_options_menu_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,10 @@ func (self *CustomPatchOptionsMenuAction) handlePullPatchIntoNewCommit() error {
_ = self.c.Helpers().Commits.PopCommitMessageContexts()
self.c.LogAction(self.c.Tr.Actions.MovePatchIntoNewCommit)
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)
stefanhaller marked this conversation as resolved.
Show resolved Hide resolved
})
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ var MoveToNewCommitPartialHunk = NewIntegrationTest(NewIntegrationTestArgs{
InitialText(Equals("")).
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().
IsFocused().
Lines(
Expand Down
Loading