diff --git a/pkg/integration/components/shell.go b/pkg/integration/components/shell.go index 4c833f2ab..faa6fff13 100644 --- a/pkg/integration/components/shell.go +++ b/pkg/integration/components/shell.go @@ -428,11 +428,11 @@ func (self *Shell) AddWorktreeCheckout(base string, path string) *Shell { }) } -func (self *Shell) AddFileInWorktree(worktreePath string) *Shell { - self.CreateFile(filepath.Join(worktreePath, "content"), "content") +func (self *Shell) AddFileInWorktreeOrSubmodule(worktreePath string, filePath string, content string) *Shell { + self.CreateFile(filepath.Join(worktreePath, filePath), content) self.RunCommand([]string{ - "git", "-C", worktreePath, "add", "content", + "git", "-C", worktreePath, "add", filePath, }) return self diff --git a/pkg/integration/tests/worktree/force_remove_worktree.go b/pkg/integration/tests/worktree/force_remove_worktree.go index 23d0b9a88..0d3bf90cf 100644 --- a/pkg/integration/tests/worktree/force_remove_worktree.go +++ b/pkg/integration/tests/worktree/force_remove_worktree.go @@ -17,7 +17,7 @@ var ForceRemoveWorktree = NewIntegrationTest(NewIntegrationTestArgs{ shell.EmptyCommit("commit 2") shell.EmptyCommit("commit 3") shell.AddWorktree("mybranch", "../linked-worktree", "newbranch") - shell.AddFileInWorktree("../linked-worktree") + shell.AddFileInWorktreeOrSubmodule("../linked-worktree", "file", "content") }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Worktrees(). diff --git a/pkg/integration/tests/worktree/remove_worktree_from_branch.go b/pkg/integration/tests/worktree/remove_worktree_from_branch.go index 7ef9d0ae9..f0b8de4e6 100644 --- a/pkg/integration/tests/worktree/remove_worktree_from_branch.go +++ b/pkg/integration/tests/worktree/remove_worktree_from_branch.go @@ -17,7 +17,7 @@ var RemoveWorktreeFromBranch = NewIntegrationTest(NewIntegrationTestArgs{ shell.EmptyCommit("commit 2") shell.EmptyCommit("commit 3") shell.AddWorktree("mybranch", "../linked-worktree", "newbranch") - shell.AddFileInWorktree("../linked-worktree") + shell.AddFileInWorktreeOrSubmodule("../linked-worktree", "file", "content") }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Branches(). diff --git a/pkg/integration/tests/worktree/reset_window_tabs.go b/pkg/integration/tests/worktree/reset_window_tabs.go index c24373be8..12c4526eb 100644 --- a/pkg/integration/tests/worktree/reset_window_tabs.go +++ b/pkg/integration/tests/worktree/reset_window_tabs.go @@ -24,7 +24,7 @@ var ResetWindowTabs = NewIntegrationTest(NewIntegrationTestArgs{ shell.EmptyCommit("commit 2") shell.EmptyCommit("commit 3") shell.AddWorktree("mybranch", "../linked-worktree", "newbranch") - shell.AddFileInWorktree("../linked-worktree") + shell.AddFileInWorktreeOrSubmodule("../linked-worktree", "file", "content") }, Run: func(t *TestDriver, keys config.KeybindingConfig) { // focus the remotes tab i.e. the second tab in the branches window