Skip to content

Commit

Permalink
Added the ability to merge a selected Tag into current branch (jessed…
Browse files Browse the repository at this point in the history
  • Loading branch information
RetoranPetra committed Mar 13, 2024
1 parent 8193731 commit e6f03bf
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/gui/controllers/tags_controller.go
Expand Up @@ -53,6 +53,11 @@ func (self *TagsController) GetKeybindings(opts types.KeybindingsOpts) []*types.
Description: self.c.Tr.ViewResetOptions,
OpensMenu: true,
},
{
Key: opts.GetKey(opts.Config.Branches.MergeIntoCurrentBranch),
Handler: opts.Guards.OutsideFilterMode(self.withSelectedTag(self.merge)),
Description: self.c.Tr.MergeIntoCurrentBranch,
},
}

return bindings
Expand Down Expand Up @@ -213,6 +218,10 @@ func (self *TagsController) create() error {
return self.c.Helpers().Tags.OpenCreateTagPrompt("", func() { self.context().SetSelectedLineIdx(0) })
}

func (self *TagsController) merge(tag *models.Tag) error {
return self.c.Helpers().MergeAndRebase.MergeRefIntoCheckedOutBranch(tag.RefName())
}

func (self *TagsController) withSelectedTag(f func(tag *models.Tag) error) func() error {
return func() error {
tag := self.context().GetSelected()
Expand Down

0 comments on commit e6f03bf

Please sign in to comment.