mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-31 14:24:25 +03:00
fix: fix RefName of detached HEAD to works in Chinese
This commit is contained in:
40
pkg/integration/tests/branch/detached_head.go
Normal file
40
pkg/integration/tests/branch/detached_head.go
Normal file
@ -0,0 +1,40 @@
|
||||
package branch
|
||||
|
||||
import (
|
||||
"github.com/jesseduffield/lazygit/pkg/config"
|
||||
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
||||
)
|
||||
|
||||
var DetachedHead = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
Description: "Create a new branch on detached head",
|
||||
ExtraCmdArgs: "",
|
||||
Skip: false,
|
||||
SetupConfig: func(config *config.AppConfig) {},
|
||||
SetupRepo: func(shell *Shell) {
|
||||
shell.
|
||||
CreateNCommits(10).
|
||||
Checkout("HEAD^")
|
||||
},
|
||||
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
||||
t.Views().Branches().
|
||||
Focus().
|
||||
Lines(
|
||||
MatchesRegexp(`\*.*HEAD`).IsSelected(),
|
||||
MatchesRegexp(`master`),
|
||||
).
|
||||
Press(keys.Universal.New)
|
||||
|
||||
t.ExpectPopup().Prompt().
|
||||
Title(MatchesRegexp(`^New Branch Name \(Branch is off of '[0-9a-f]+'\)$`)).
|
||||
Type("new-branch").
|
||||
Confirm()
|
||||
|
||||
t.Views().Branches().
|
||||
Lines(
|
||||
MatchesRegexp(`\* new-branch`).IsSelected(),
|
||||
MatchesRegexp(`master`),
|
||||
)
|
||||
|
||||
t.Git().CurrentBranchName("new-branch")
|
||||
},
|
||||
})
|
@ -38,6 +38,7 @@ var tests = []*components.IntegrationTest{
|
||||
branch.RebaseAndDrop,
|
||||
branch.Suggestions,
|
||||
branch.Reset,
|
||||
branch.DetachedHead,
|
||||
cherry_pick.CherryPick,
|
||||
cherry_pick.CherryPickConflicts,
|
||||
commit.Commit,
|
||||
|
Reference in New Issue
Block a user