1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-04-17 12:06:38 +02:00

Add an integration test for a config with a negative refspec

This commit is contained in:
Kevin Radloff 2025-03-09 16:23:40 -04:00 committed by Stefan Haller
parent bf6d2a1c28
commit b76b73943a
2 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,25 @@
package config
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var NegativeRefspec = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Having a config with a negative refspec",
ExtraCmdArgs: []string{},
GitVersion: AtLeast("2.29.0"),
SetupRepo: func(shell *Shell) {
shell.
SetConfig("remote.origin.fetch", "^refs/heads/test").
CreateNCommits(2)
},
SetupConfig: func(cfg *config.AppConfig) {},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
// the failure case with an unpatched go-git is that no branches display
t.Views().Branches().
Lines(
Contains("master"),
)
},
})

View File

@ -130,6 +130,7 @@ var tests = []*components.IntegrationTest{
commit.StagedWithoutHooks,
commit.Unstaged,
config.CustomCommandsInPerRepoConfig,
config.NegativeRefspec,
config.RemoteNamedStar,
conflicts.Filter,
conflicts.ResolveExternally,