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 (#2990)

This commit is contained in:
Jesse Duffield
2023-09-09 17:34:57 +10:00
committed by GitHub
4 changed files with 40 additions and 4 deletions

View File

@ -600,7 +600,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)
}