diff options
author | Cal Courtney <cal@absmartly.com> | 2023-09-05 13:34:38 +0100 |
---|---|---|
committer | Cal Courtney <cal@absmartly.com> | 2023-09-05 14:57:18 +0100 |
commit | c3ca77d6bfdc742dbb9a6125f74df15137513eab (patch) | |
tree | 22f3aeaff30618ed905e10ff13d6f888fc294acc /pkg/gui/controllers/helpers/refs_helper.go | |
parent | a3cd1e93be25517657d091e7ba7be0236768425f (diff) |
Replace whitespace with '-' when renaming a branch
Diffstat (limited to 'pkg/gui/controllers/helpers/refs_helper.go')
-rw-r--r-- | pkg/gui/controllers/helpers/refs_helper.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/gui/controllers/helpers/refs_helper.go b/pkg/gui/controllers/helpers/refs_helper.go index 765b01cd5..a6de0d39f 100644 --- a/pkg/gui/controllers/helpers/refs_helper.go +++ b/pkg/gui/controllers/helpers/refs_helper.go @@ -165,7 +165,7 @@ func (self *RefsHelper) NewBranch(from string, fromFormattedName string, suggest InitialContent: suggestedBranchName, HandleConfirm: func(response string) error { self.c.LogAction(self.c.Tr.Actions.CreateBranch) - if err := self.c.Git().Branch.New(sanitizedBranchName(response), from); err != nil { + if err := self.c.Git().Branch.New(SanitizedBranchName(response), from); err != nil { return err } @@ -183,8 +183,8 @@ func (self *RefsHelper) NewBranch(from string, fromFormattedName string, suggest }) } -// sanitizedBranchName will remove all spaces in favor of a dash "-" to meet +// SanitizedBranchName will remove all spaces in favor of a dash "-" to meet // git's branch naming requirement. -func sanitizedBranchName(input string) string { +func SanitizedBranchName(input string) string { return strings.Replace(input, " ", "-", -1) } |