diff --git a/pkg/integration/tests/test_list.go b/pkg/integration/tests/test_list.go index 16de7805a..fac10efb4 100644 --- a/pkg/integration/tests/test_list.go +++ b/pkg/integration/tests/test_list.go @@ -557,4 +557,5 @@ var tests = []*components.IntegrationTest{ worktree.SeparateWorkTreeConfig, worktree.SymlinkIntoRepoSubdir, worktree.WorktreeInRepo, + worktree.WorktreeInsideRepo, } diff --git a/pkg/integration/tests/worktree/worktree_inside_repo.go b/pkg/integration/tests/worktree/worktree_inside_repo.go new file mode 100644 index 000000000..bae2ff8f1 --- /dev/null +++ b/pkg/integration/tests/worktree/worktree_inside_repo.go @@ -0,0 +1,28 @@ +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(), + ) + }, +})