Skip to content

Commit b76b739

Browse files
radsaqstefanhaller
authored andcommitted
Add an integration test for a config with a negative refspec
1 parent bf6d2a1 commit b76b739

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package config
2+
3+
import (
4+
"github.com/jesseduffield/lazygit/pkg/config"
5+
. "github.com/jesseduffield/lazygit/pkg/integration/components"
6+
)
7+
8+
var NegativeRefspec = NewIntegrationTest(NewIntegrationTestArgs{
9+
Description: "Having a config with a negative refspec",
10+
ExtraCmdArgs: []string{},
11+
GitVersion: AtLeast("2.29.0"),
12+
SetupRepo: func(shell *Shell) {
13+
shell.
14+
SetConfig("remote.origin.fetch", "^refs/heads/test").
15+
CreateNCommits(2)
16+
},
17+
SetupConfig: func(cfg *config.AppConfig) {},
18+
Run: func(t *TestDriver, keys config.KeybindingConfig) {
19+
// the failure case with an unpatched go-git is that no branches display
20+
t.Views().Branches().
21+
Lines(
22+
Contains("master"),
23+
)
24+
},
25+
})

pkg/integration/tests/test_list.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ var tests = []*components.IntegrationTest{
130130
commit.StagedWithoutHooks,
131131
commit.Unstaged,
132132
config.CustomCommandsInPerRepoConfig,
133+
config.NegativeRefspec,
133134
config.RemoteNamedStar,
134135
conflicts.Filter,
135136
conflicts.ResolveExternally,

0 commit comments

Comments
 (0)