mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 12:25:47 +02:00
add branch rebase integration test
This commit is contained in:
parent
843488bff4
commit
7b757d1cfe
126 changed files with 309 additions and 241 deletions
|
@ -40,6 +40,15 @@ func (s *Shell) CreateFile(path string, content string) *Shell {
|
|||
return s
|
||||
}
|
||||
|
||||
func (s *Shell) UpdateFile(path string, content string) *Shell {
|
||||
err := ioutil.WriteFile(path, []byte(content), 0o644)
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("error updating file: %s\n%s", path, err))
|
||||
}
|
||||
|
||||
return s
|
||||
}
|
||||
|
||||
func (s *Shell) NewBranch(name string) *Shell {
|
||||
return s.RunCommand("git checkout -b " + name)
|
||||
}
|
||||
|
@ -71,6 +80,13 @@ func (s *Shell) CreateFileAndAdd(fileName string, fileContents string) *Shell {
|
|||
GitAdd(fileName)
|
||||
}
|
||||
|
||||
// convenience method for updating a file and adding it
|
||||
func (s *Shell) UpdateFileAndAdd(fileName string, fileContents string) *Shell {
|
||||
return s.
|
||||
UpdateFile(fileName, fileContents).
|
||||
GitAdd(fileName)
|
||||
}
|
||||
|
||||
// creates commits 01, 02, 03, ..., n with a new file in each
|
||||
// The reason for padding with zeroes is so that it's easier to do string
|
||||
// matches on the commit messages when there are many of them
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue