1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-15 00:15:32 +02:00

Replace whitespace with '-' when renaming a branch

This commit is contained in:
Cal Courtney
2023-09-05 13:34:38 +01:00
parent a3cd1e93be
commit c3ca77d6bf
4 changed files with 40 additions and 4 deletions

View File

@ -557,7 +557,7 @@ func (self *BranchesController) rename(branch *models.Branch) error {
InitialContent: branch.Name,
HandleConfirm: func(newBranchName string) error {
self.c.LogAction(self.c.Tr.Actions.RenameBranch)
if err := self.c.Git().Branch.Rename(branch.Name, newBranchName); err != nil {
if err := self.c.Git().Branch.Rename(branch.Name, helpers.SanitizedBranchName(newBranchName)); err != nil {
return self.c.Error(err)
}