mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-10-08 22:52:12 +02:00
Rename AddFileInWorktree to AddFileInWorktreeOrSubmodule
It works for submodules too. Also, pass file name and file content explicitly; the existing tests don't care about these, but when writing tests that do, it makes them easier to understand.
This commit is contained in:
@@ -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
|
||||
|
@@ -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().
|
||||
|
@@ -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().
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user