summaryrefslogtreecommitdiffstats
path: root/pkg/gui/controllers/helpers
diff options
context:
space:
mode:
authorRyooooooga <eial5q265e5@gmail.com>2023-02-08 22:40:18 +0900
committerRyooooooga <eial5q265e5@gmail.com>2023-02-19 23:31:46 +0900
commit67b08ac2395b350779f5fc72d75bd7180f7da394 (patch)
treec419dfa156fd08e96fa069990af28f8b6e495211 /pkg/gui/controllers/helpers
parentb54b8ae746a008daa7e7006094c9a533a88eff1d (diff)
feat: support to create tag on branch
Diffstat (limited to 'pkg/gui/controllers/helpers')
-rw-r--r--pkg/gui/controllers/helpers/tags_helper.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/pkg/gui/controllers/helpers/tags_helper.go b/pkg/gui/controllers/helpers/tags_helper.go
index 4683ffd0d..a2f2e9c77 100644
--- a/pkg/gui/controllers/helpers/tags_helper.go
+++ b/pkg/gui/controllers/helpers/tags_helper.go
@@ -21,20 +21,20 @@ func NewTagsHelper(c *types.HelperCommon, git *commands.GitCommand) *TagsHelper
}
}
-func (self *TagsHelper) CreateTagMenu(commitSha string, onCreate func()) error {
+func (self *TagsHelper) CreateTagMenu(ref string, onCreate func()) error {
return self.c.Menu(types.CreateMenuOptions{
Title: self.c.Tr.TagMenuTitle,
Items: []*types.MenuItem{
{
Label: self.c.Tr.LcLightweightTag,
OnPress: func() error {
- return self.handleCreateLightweightTag(commitSha, onCreate)
+ return self.handleCreateLightweightTag(ref, onCreate)
},
},
{
Label: self.c.Tr.LcAnnotatedTag,
OnPress: func() error {
- return self.handleCreateAnnotatedTag(commitSha, onCreate)
+ return self.handleCreateAnnotatedTag(ref, onCreate)
},
},
},
@@ -48,7 +48,7 @@ func (self *TagsHelper) afterTagCreate(onCreate func()) error {
})
}
-func (self *TagsHelper) handleCreateAnnotatedTag(commitSha string, onCreate func()) error {
+func (self *TagsHelper) handleCreateAnnotatedTag(ref string, onCreate func()) error {
return self.c.Prompt(types.PromptOpts{
Title: self.c.Tr.TagNameTitle,
HandleConfirm: func(tagName string) error {
@@ -56,7 +56,7 @@ func (self *TagsHelper) handleCreateAnnotatedTag(commitSha string, onCreate func
Title: self.c.Tr.TagMessageTitle,
HandleConfirm: func(msg string) error {
self.c.LogAction(self.c.Tr.Actions.CreateAnnotatedTag)
- if err := self.git.Tag.CreateAnnotated(tagName, commitSha, msg); err != nil {
+ if err := self.git.Tag.CreateAnnotated(tagName, ref, msg); err != nil {
return self.c.Error(err)
}
return self.afterTagCreate(onCreate)
@@ -66,12 +66,12 @@ func (self *TagsHelper) handleCreateAnnotatedTag(commitSha string, onCreate func
})
}
-func (self *TagsHelper) handleCreateLightweightTag(commitSha string, onCreate func()) error {
+func (self *TagsHelper) handleCreateLightweightTag(ref string, onCreate func()) error {
return self.c.Prompt(types.PromptOpts{
Title: self.c.Tr.TagNameTitle,
HandleConfirm: func(tagName string) error {
self.c.LogAction(self.c.Tr.Actions.CreateLightweightTag)
- if err := self.git.Tag.CreateLightweight(tagName, commitSha); err != nil {
+ if err := self.git.Tag.CreateLightweight(tagName, ref); err != nil {
return self.c.Error(err)
}
return self.afterTagCreate(onCreate)