1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-12 13:21:42 +03:00

Fix unstable tests

Now that -committerdate is the default sort order, we could get different
results for the sort order of the branches list depending on whether the commits
on both branches have the same committer time stamp (likely in an integration
test, since git time stamps have second resolution), in which case git will fall
back to alphabetical order, or not (rare, but possible), in which case master
will have the newer commit and will come first. Make this stable by forcing the
sort order to alphabetical.

We might have more tests with this problem, we'll just have to fix them one by
one as we see them fail.
This commit is contained in:
Stefan Haller
2025-07-09 15:37:47 +02:00
parent 8026fc2bb9
commit 457cdce61d
2 changed files with 4 additions and 1 deletions

View File

@ -9,7 +9,9 @@ var CheckoutByName = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Try to checkout branch by name. Verify that it also works on the branch with the special name @.", Description: "Try to checkout branch by name. Verify that it also works on the branch with the special name @.",
ExtraCmdArgs: []string{}, ExtraCmdArgs: []string{},
Skip: false, Skip: false,
SetupConfig: func(config *config.AppConfig) {}, SetupConfig: func(config *config.AppConfig) {
config.GetUserConfig().Git.LocalBranchSortOrder = "alphabetical"
},
SetupRepo: func(shell *Shell) { SetupRepo: func(shell *Shell) {
shell. shell.
CreateNCommits(3). CreateNCommits(3).

View File

@ -11,6 +11,7 @@ var Delete = NewIntegrationTest(NewIntegrationTestArgs{
Skip: false, Skip: false,
SetupConfig: func(config *config.AppConfig) { SetupConfig: func(config *config.AppConfig) {
config.GetUserConfig().Git.LocalBranchSortOrder = "recency" config.GetUserConfig().Git.LocalBranchSortOrder = "recency"
config.GetUserConfig().Git.RemoteBranchSortOrder = "alphabetical"
}, },
SetupRepo: func(shell *Shell) { SetupRepo: func(shell *Shell) {
shell. shell.