mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-03 00:57:52 +02:00
Store full ref in Name field of update-ref commits
Strip the prefix at presentation time instead. This makes it easier to find update-ref todos in order to move them up/down, or delete them.
This commit is contained in:
@ -348,7 +348,7 @@ func (self *CommitLoader) getRebasingCommits(rebaseMode enums.RebaseMode) []*mod
|
|||||||
|
|
||||||
for _, t := range todos {
|
for _, t := range todos {
|
||||||
if t.Command == todo.UpdateRef {
|
if t.Command == todo.UpdateRef {
|
||||||
t.Msg = strings.TrimPrefix(t.Ref, "refs/heads/")
|
t.Msg = t.Ref
|
||||||
} else if t.Commit == "" {
|
} else if t.Commit == "" {
|
||||||
// Command does not have a commit associated, skip
|
// Command does not have a commit associated, skip
|
||||||
continue
|
continue
|
||||||
|
@ -282,7 +282,7 @@ func (self *LocalCommitsController) GetOnRenderToMain() func() error {
|
|||||||
utils.ResolvePlaceholderString(
|
utils.ResolvePlaceholderString(
|
||||||
self.c.Tr.UpdateRefHere,
|
self.c.Tr.UpdateRefHere,
|
||||||
map[string]string{
|
map[string]string{
|
||||||
"ref": commit.Name,
|
"ref": strings.TrimPrefix(commit.Name, "refs/heads/"),
|
||||||
}))
|
}))
|
||||||
} else {
|
} else {
|
||||||
cmdObj := self.c.Git().Commit.ShowCmdObj(commit.Sha, self.c.Modes().Filtering.GetPath())
|
cmdObj := self.c.Git().Commit.ShowCmdObj(commit.Sha, self.c.Modes().Filtering.GetPath())
|
||||||
|
@ -342,6 +342,9 @@ func displayCommit(
|
|||||||
}
|
}
|
||||||
|
|
||||||
name := commit.Name
|
name := commit.Name
|
||||||
|
if commit.Action == todo.UpdateRef {
|
||||||
|
name = strings.TrimPrefix(name, "refs/heads/")
|
||||||
|
}
|
||||||
if parseEmoji {
|
if parseEmoji {
|
||||||
name = emoji.Sprint(name)
|
name = emoji.Sprint(name)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user