mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-10 07:36:27 -04:00
Add an integration test for a config with a negative refspec (#4382)
Some checks are pending
Continuous Integration / ci - ${{matrix.os}} (~/.cache/go-build, ubuntu-latest) (push) Waiting to run
Continuous Integration / ci - ${{matrix.os}} (~\AppData\Local\go-build, windows-latest) (push) Waiting to run
Continuous Integration / Integration Tests - git ${{matrix.git-version}} (2.20.0) (push) Waiting to run
Continuous Integration / Integration Tests - git ${{matrix.git-version}} (2.22.5) (push) Waiting to run
Continuous Integration / Integration Tests - git ${{matrix.git-version}} (2.23.0) (push) Waiting to run
Continuous Integration / Integration Tests - git ${{matrix.git-version}} (2.25.1) (push) Waiting to run
Continuous Integration / Integration Tests - git ${{matrix.git-version}} (2.30.8) (push) Waiting to run
Continuous Integration / Integration Tests - git ${{matrix.git-version}} (latest) (push) Waiting to run
Continuous Integration / build (push) Waiting to run
Continuous Integration / check-codebase (push) Waiting to run
Continuous Integration / lint (push) Waiting to run
Continuous Integration / check-required-label (push) Waiting to run
Continuous Integration / upload-coverage (push) Blocked by required conditions
Continuous Integration / check-for-fixups (push) Waiting to run
Codespell / Check for spelling errors (push) Waiting to run
Generate Sponsors README / deploy (push) Waiting to run
Some checks are pending
Continuous Integration / ci - ${{matrix.os}} (~/.cache/go-build, ubuntu-latest) (push) Waiting to run
Continuous Integration / ci - ${{matrix.os}} (~\AppData\Local\go-build, windows-latest) (push) Waiting to run
Continuous Integration / Integration Tests - git ${{matrix.git-version}} (2.20.0) (push) Waiting to run
Continuous Integration / Integration Tests - git ${{matrix.git-version}} (2.22.5) (push) Waiting to run
Continuous Integration / Integration Tests - git ${{matrix.git-version}} (2.23.0) (push) Waiting to run
Continuous Integration / Integration Tests - git ${{matrix.git-version}} (2.25.1) (push) Waiting to run
Continuous Integration / Integration Tests - git ${{matrix.git-version}} (2.30.8) (push) Waiting to run
Continuous Integration / Integration Tests - git ${{matrix.git-version}} (latest) (push) Waiting to run
Continuous Integration / build (push) Waiting to run
Continuous Integration / check-codebase (push) Waiting to run
Continuous Integration / lint (push) Waiting to run
Continuous Integration / check-required-label (push) Waiting to run
Continuous Integration / upload-coverage (push) Blocked by required conditions
Continuous Integration / check-for-fixups (push) Waiting to run
Codespell / Check for spelling errors (push) Waiting to run
Generate Sponsors README / deploy (push) Waiting to run
- **PR Description** This is a sanity check to verify that lazygit has been built with a patched version of go-git that does not error on negative refspecs. - **Please check if the PR fulfills these requirements** * [x] Cheatsheets are up-to-date (run `go generate ./...`) * [x] Code has been formatted (see [here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#code-formatting)) * [x] Tests have been added/updated (see [here](https://github.com/jesseduffield/lazygit/blob/master/pkg/integration/README.md) for the integration test guide) * [x] Text is internationalised (see [here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#internationalisation)) * [x] If a new UserConfig entry was added, make sure it can be hot-reloaded (see [here](https://github.com/jesseduffield/lazygit/blob/master/docs/dev/Codebase_Guide.md#using-userconfig)) * [x] Docs have been updated if necessary * [x] You've read through your own file changes for silly mistakes etc
This commit is contained in:
commit
d423d2ac3d
25
pkg/integration/tests/config/negative_refspec.go
Normal file
25
pkg/integration/tests/config/negative_refspec.go
Normal 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"),
|
||||
)
|
||||
},
|
||||
})
|
||||
|
|
@ -130,6 +130,7 @@ var tests = []*components.IntegrationTest{
|
|||
commit.StagedWithoutHooks,
|
||||
commit.Unstaged,
|
||||
config.CustomCommandsInPerRepoConfig,
|
||||
config.NegativeRefspec,
|
||||
config.RemoteNamedStar,
|
||||
conflicts.Filter,
|
||||
conflicts.ResolveExternally,
|
||||
|
|
|
|||
Loading…
Reference in a new issue