mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-17 22:32:58 +02:00
Remove unnecessary nil error in NewPullRequest.
This commit is contained in:
parent
df0e3e52fe
commit
c69fce2e9d
@ -44,11 +44,11 @@ func getServices() []*Service {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewPullRequest creates new instance of PullRequest
|
// NewPullRequest creates new instance of PullRequest
|
||||||
func NewPullRequest(gitCommand *GitCommand) (*PullRequest, error) {
|
func NewPullRequest(gitCommand *GitCommand) *PullRequest {
|
||||||
return &PullRequest{
|
return &PullRequest{
|
||||||
GitServices: getServices(),
|
GitServices: getServices(),
|
||||||
GitCommand: gitCommand,
|
GitCommand: gitCommand,
|
||||||
}, nil
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create opens link to new pull request in browser
|
// Create opens link to new pull request in browser
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
package commands
|
package commands
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/stretchr/testify/assert"
|
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestGetRepoInfoFromURL(t *testing.T) {
|
func TestGetRepoInfoFromURL(t *testing.T) {
|
||||||
@ -144,7 +145,7 @@ func TestCreatePullRequest(t *testing.T) {
|
|||||||
gitCommand := newDummyGitCommand()
|
gitCommand := newDummyGitCommand()
|
||||||
gitCommand.OSCommand.command = s.command
|
gitCommand.OSCommand.command = s.command
|
||||||
gitCommand.OSCommand.Config.GetUserConfig().Set("os.openCommand", "open {{filename}}")
|
gitCommand.OSCommand.Config.GetUserConfig().Set("os.openCommand", "open {{filename}}")
|
||||||
dummyPullRequest, _ := NewPullRequest(gitCommand)
|
dummyPullRequest := NewPullRequest(gitCommand)
|
||||||
s.test(dummyPullRequest.Create(s.branch))
|
s.test(dummyPullRequest.Create(s.branch))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ func (gui *Gui) handleBranchPress(g *gocui.Gui, v *gocui.View) error {
|
|||||||
|
|
||||||
func (gui *Gui) handleCreatePullRequestPress(g *gocui.Gui, v *gocui.View) error {
|
func (gui *Gui) handleCreatePullRequestPress(g *gocui.Gui, v *gocui.View) error {
|
||||||
branch := gui.getSelectedBranch(gui.getBranchesView(g))
|
branch := gui.getSelectedBranch(gui.getBranchesView(g))
|
||||||
pullRequest, _ := commands.NewPullRequest(gui.GitCommand)
|
pullRequest := commands.NewPullRequest(gui.GitCommand)
|
||||||
|
|
||||||
if err := pullRequest.Create(branch); err != nil {
|
if err := pullRequest.Create(branch); err != nil {
|
||||||
return gui.createErrorPanel(g, err.Error())
|
return gui.createErrorPanel(g, err.Error())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user