mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-10 07:36:27 -04:00
We show this with a worktree icon (which is only shown when nerd fonts are used, so turn these on), but also we strip the trailing `/` that "git status" reports, so that it shows as a file rather than a directory with a bogus file in it. The reason for adding the test is that we are going to touch the logic that determines whether an item in the Files panel is a linked worktree, and this guards against regressing.
29 lines
864 B
Go
29 lines
864 B
Go
package worktree
|
|
|
|
import (
|
|
"github.com/jesseduffield/lazygit/pkg/config"
|
|
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
|
)
|
|
|
|
var WorktreeInsideRepo = NewIntegrationTest(NewIntegrationTestArgs{
|
|
Description: "A worktree that lives inside the repo's working tree is shown as a single item in the files panel",
|
|
ExtraCmdArgs: []string{},
|
|
Skip: false,
|
|
SetupConfig: func(config *config.AppConfig) {
|
|
config.GetUserConfig().Gui.NerdFontsVersion = "3"
|
|
},
|
|
SetupRepo: func(shell *Shell) {
|
|
shell.NewBranch("mybranch")
|
|
shell.CreateFileAndAdd("README.md", "hello world")
|
|
shell.Commit("initial commit")
|
|
shell.AddWorktree("mybranch", "nested-worktree", "newbranch")
|
|
},
|
|
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
|
t.Views().Files().
|
|
IsFocused().
|
|
Lines(
|
|
Equals("?? nested-worktree").IsSelected(),
|
|
)
|
|
},
|
|
})
|