Fix test by making branches appear deterministically

This fixes pkg/integration/tests/worktree/rebase.go which was failing on old git versions due to a difference in
order of branches that don't have recency values
This commit is contained in:
Jesse Duffield 2023-07-27 19:14:47 +10:00
parent e356b29b4a
commit 0a410141ae

View file

@ -81,6 +81,12 @@ outer:
}
}
// Sort branches that don't have a recency value alphabetically
// (we're really doing this for the sake of deterministic behaviour across git versions)
slices.SortFunc(branches, func(a *models.Branch, b *models.Branch) bool {
return a.Name < b.Name
})
branches = slices.Prepend(branches, branchesWithRecency...)
foundHead := false