mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-04-23 12:18:51 +02:00
Fix checking out a tag when a branch with the same name exists
This commit is contained in:
parent
2b97f0fb43
commit
f244ec8251
@ -83,7 +83,7 @@ func (self *TagsController) GetOnRenderToMain() func() error {
|
||||
|
||||
func (self *TagsController) checkout(tag *models.Tag) error {
|
||||
self.c.LogAction(self.c.Tr.Actions.CheckoutTag)
|
||||
if err := self.c.Helpers().Refs.CheckoutRef(tag.Name, types.CheckoutRefOptions{}); err != nil {
|
||||
if err := self.c.Helpers().Refs.CheckoutRef(tag.FullRefName(), types.CheckoutRefOptions{}); err != nil {
|
||||
return err
|
||||
}
|
||||
return self.c.PushContext(self.c.Contexts().Branches)
|
||||
|
@ -26,13 +26,9 @@ var CheckoutWhenBranchWithSameNameExists = NewIntegrationTest(NewIntegrationTest
|
||||
PressPrimaryAction() // checkout tag
|
||||
|
||||
t.Views().Branches().IsFocused().Lines(
|
||||
/* EXPECTED:
|
||||
Contains("HEAD detached at tag").IsSelected(),
|
||||
Contains("master"),
|
||||
Contains("tag"),
|
||||
ACTUAL: */
|
||||
Contains("* tag").DoesNotContain("HEAD detached").IsSelected(),
|
||||
Contains("master"),
|
||||
)
|
||||
},
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user