mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-19 22:33:16 +02:00
Merge pull request #1944 from Ryooooooga/feature/fix-ambiguous-refname
This commit is contained in:
commit
8e7f6822fc
@ -18,6 +18,10 @@ type Branch struct {
|
|||||||
UpstreamBranch string
|
UpstreamBranch string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (b *Branch) FullRefName() string {
|
||||||
|
return "refs/heads/" + b.Name
|
||||||
|
}
|
||||||
|
|
||||||
func (b *Branch) RefName() string {
|
func (b *Branch) RefName() string {
|
||||||
return b.Name
|
return b.Name
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,10 @@ func (c *Commit) ShortSha() string {
|
|||||||
return utils.ShortSha(c.Sha)
|
return utils.ShortSha(c.Sha)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *Commit) FullRefName() string {
|
||||||
|
return c.Sha
|
||||||
|
}
|
||||||
|
|
||||||
func (c *Commit) RefName() string {
|
func (c *Commit) RefName() string {
|
||||||
return c.Sha
|
return c.Sha
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,10 @@ func (r *RemoteBranch) FullName() string {
|
|||||||
return r.RemoteName + "/" + r.Name
|
return r.RemoteName + "/" + r.Name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (r *RemoteBranch) FullRefName() string {
|
||||||
|
return "refs/remotes/" + r.FullName()
|
||||||
|
}
|
||||||
|
|
||||||
func (r *RemoteBranch) RefName() string {
|
func (r *RemoteBranch) RefName() string {
|
||||||
return r.FullName()
|
return r.FullName()
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,10 @@ type StashEntry struct {
|
|||||||
Name string
|
Name string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *StashEntry) FullRefName() string {
|
||||||
|
return s.RefName()
|
||||||
|
}
|
||||||
|
|
||||||
func (s *StashEntry) RefName() string {
|
func (s *StashEntry) RefName() string {
|
||||||
return fmt.Sprintf("stash@{%d}", s.Index)
|
return fmt.Sprintf("stash@{%d}", s.Index)
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,10 @@ type Tag struct {
|
|||||||
Name string
|
Name string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (t *Tag) FullRefName() string {
|
||||||
|
return "refs/tags/" + t.RefName()
|
||||||
|
}
|
||||||
|
|
||||||
func (t *Tag) RefName() string {
|
func (t *Tag) RefName() string {
|
||||||
return t.Name
|
return t.Name
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ func (gui *Gui) branchesRenderToMain() error {
|
|||||||
if branch == nil {
|
if branch == nil {
|
||||||
task = NewRenderStringTask(gui.c.Tr.NoBranchesThisRepo)
|
task = NewRenderStringTask(gui.c.Tr.NoBranchesThisRepo)
|
||||||
} else {
|
} else {
|
||||||
cmdObj := gui.git.Branch.GetGraphCmdObj(branch.Name)
|
cmdObj := gui.git.Branch.GetGraphCmdObj(branch.FullRefName())
|
||||||
|
|
||||||
task = NewRunPtyTask(cmdObj.GetCmd())
|
task = NewRunPtyTask(cmdObj.GetCmd())
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ func (self *SwitchToSubCommitsController) viewCommits() error {
|
|||||||
Limit: true,
|
Limit: true,
|
||||||
FilterPath: self.modes.Filtering.GetPath(),
|
FilterPath: self.modes.Filtering.GetPath(),
|
||||||
IncludeRebaseCommits: false,
|
IncludeRebaseCommits: false,
|
||||||
RefName: ref.RefName(),
|
RefName: ref.FullRefName(),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -6,7 +6,7 @@ func (gui *Gui) remoteBranchesRenderToMain() error {
|
|||||||
if remoteBranch == nil {
|
if remoteBranch == nil {
|
||||||
task = NewRenderStringTask("No branches for this remote")
|
task = NewRenderStringTask("No branches for this remote")
|
||||||
} else {
|
} else {
|
||||||
cmdObj := gui.git.Branch.GetGraphCmdObj(remoteBranch.FullName())
|
cmdObj := gui.git.Branch.GetGraphCmdObj(remoteBranch.FullRefName())
|
||||||
task = NewRunCommandTask(cmdObj.GetCmd())
|
task = NewRunCommandTask(cmdObj.GetCmd())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ func (self *Gui) tagsRenderToMain() error {
|
|||||||
if tag == nil {
|
if tag == nil {
|
||||||
task = NewRenderStringTask("No tags")
|
task = NewRenderStringTask("No tags")
|
||||||
} else {
|
} else {
|
||||||
cmdObj := self.git.Branch.GetGraphCmdObj(tag.Name)
|
cmdObj := self.git.Branch.GetGraphCmdObj(tag.FullRefName())
|
||||||
task = NewRunCommandTask(cmdObj.GetCmd())
|
task = NewRunCommandTask(cmdObj.GetCmd())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package types
|
package types
|
||||||
|
|
||||||
type Ref interface {
|
type Ref interface {
|
||||||
|
FullRefName() string
|
||||||
RefName() string
|
RefName() string
|
||||||
ParentRefName() string
|
ParentRefName() string
|
||||||
Description() string
|
Description() string
|
||||||
|
Loading…
x
Reference in New Issue
Block a user