diff --git a/pkg/integration/tests/config/negative_refspec.go b/pkg/integration/tests/config/negative_refspec.go new file mode 100644 index 000000000..0859722f4 --- /dev/null +++ b/pkg/integration/tests/config/negative_refspec.go @@ -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"), + ) + }, +}) diff --git a/pkg/integration/tests/test_list.go b/pkg/integration/tests/test_list.go index 69a9ed5ec..6ff5c2f07 100644 --- a/pkg/integration/tests/test_list.go +++ b/pkg/integration/tests/test_list.go @@ -130,6 +130,7 @@ var tests = []*components.IntegrationTest{ commit.StagedWithoutHooks, commit.Unstaged, config.CustomCommandsInPerRepoConfig, + config.NegativeRefspec, config.RemoteNamedStar, conflicts.Filter, conflicts.ResolveExternally,