1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-11-29 22:48:24 +02:00

Use upstream branch when opening pull requests (#2693)

- **PR Description**

Should probably solve #2691

- **Please check if the PR fulfills these requirements**

* [x] Cheatsheets are up-to-date (run `go run scripts/cheatsheet/main.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] Docs (specifically `docs/Config.md`) have been updated if
necessary
* [x] You've read through your own file changes for silly mistakes etc
This commit is contained in:
Jesse Duffield
2023-09-25 11:03:15 +10:00
committed by GitHub
4 changed files with 38 additions and 4 deletions

View File

@@ -0,0 +1,25 @@
package branch
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var OpenPullRequestNoUpstream = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Open up a pull request with a missing upstream branch",
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {},
SetupRepo: func(shell *Shell) {},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.Views().
Branches().
Focus().
Press(keys.Branches.CreatePullRequest)
t.ExpectPopup().Alert().
Title(Equals("Error")).
Content(Contains("Cannot open a pull request for a branch with no upstream")).
Confirm()
},
})

View File

@@ -40,6 +40,7 @@ var tests = []*components.IntegrationTest{
branch.Delete,
branch.DeleteRemoteBranchWithCredentialPrompt,
branch.DetachedHead,
branch.OpenPullRequestNoUpstream,
branch.OpenWithCliArg,
branch.Rebase,
branch.RebaseAbortOnConflict,