Add integration test for dropping a todo commit when there's an update-ref

The test shows how we are accidentally dropping the wrong commit in this case.
We'll fix that in the next commit.
This commit is contained in:
Stefan Haller 2023-04-13 20:24:28 +02:00
parent a304fed68c
commit 860a8d102b
3 changed files with 78 additions and 1 deletions

View file

@ -192,7 +192,11 @@ func (self *Shell) DeleteFileAndAdd(fileName string) *Shell {
// 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
func (self *Shell) CreateNCommits(n int) *Shell {
for i := 1; i <= n; i++ {
return self.CreateNCommitsStartingAt(n, 1)
}
func (self *Shell) CreateNCommitsStartingAt(n, startIndex int) *Shell {
for i := startIndex; i < startIndex+n; i++ {
self.CreateFileAndAdd(
fmt.Sprintf("file%02d.txt", i),
fmt.Sprintf("file%02d content", i),