1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03: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

@ -0,0 +1,35 @@
package branch
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var Rename = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Rename a branch, replacing spaces in the name with dashes",
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {},
SetupRepo: func(shell *Shell) {
shell.EmptyCommit("commit")
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Branches().
Focus().
Lines(
Contains("master"),
).
Press(keys.Branches.RenameBranch).
Tap(func() {
t.ExpectPopup().Prompt().
Title(Contains("Enter new branch name")).
InitialText(Equals("master")).
Clear().
Type("new branch name").
Confirm()
}).
Lines(
Contains("new-branch-name"),
)
},
})

View File

@ -46,6 +46,7 @@ var tests = []*components.IntegrationTest{
branch.RebaseCancelOnConflict,
branch.RebaseDoesNotAutosquash,
branch.RebaseFromMarkedBase,
branch.Rename,
branch.Reset,
branch.ResetToUpstream,
branch.ResetUpstream,