mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-10-20 19:12:29 +03: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
|
||||
|
Reference in New Issue
Block a user