mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 04:15:48 +02:00
Add test for opening lazygit in the worktree of a bare repo
This commit is contained in:
parent
e874f94cf8
commit
2b24c15938
5 changed files with 109 additions and 28 deletions
|
@ -85,7 +85,7 @@ func (self *Shell) CreateFile(path string, content string) *Shell {
|
|||
|
||||
func (self *Shell) DeleteFile(path string) *Shell {
|
||||
fullPath := filepath.Join(self.dir, path)
|
||||
err := os.Remove(fullPath)
|
||||
err := os.RemoveAll(fullPath)
|
||||
if err != nil {
|
||||
self.fail(fmt.Sprintf("error deleting file: %s\n%s", fullPath, err))
|
||||
}
|
||||
|
@ -328,3 +328,11 @@ func (self *Shell) CopyFile(source string, destination string) *Shell {
|
|||
|
||||
return self
|
||||
}
|
||||
|
||||
// NOTE: this only takes effect before running the test;
|
||||
// the test will still run in the original directory
|
||||
func (self *Shell) Chdir(path string) *Shell {
|
||||
self.dir = filepath.Join(self.dir, path)
|
||||
|
||||
return self
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue