1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-17 00:18:05 +02:00

full coverage for logging commands

This commit is contained in:
Jesse Duffield
2021-04-10 17:31:23 +10:00
parent 74320f0075
commit 6fbe660f96
18 changed files with 119 additions and 63 deletions

View File

@ -90,23 +90,23 @@ func NewPullRequest(gitCommand *GitCommand) *PullRequest {
}
// Create opens link to new pull request in browser
func (pr *PullRequest) Create(branch *models.Branch) error {
func (pr *PullRequest) Create(branch *models.Branch) (string, error) {
pullRequestURL, err := pr.getPullRequestURL(branch)
if err != nil {
return err
return "", err
}
return pr.GitCommand.OSCommand.OpenLink(pullRequestURL)
return pullRequestURL, pr.GitCommand.OSCommand.OpenLink(pullRequestURL)
}
// CopyURL copies the pull request URL to the clipboard
func (pr *PullRequest) CopyURL(branch *models.Branch) error {
func (pr *PullRequest) CopyURL(branch *models.Branch) (string, error) {
pullRequestURL, err := pr.getPullRequestURL(branch)
if err != nil {
return err
return "", err
}
return pr.GitCommand.OSCommand.CopyToClipboard(pullRequestURL)
return pullRequestURL, pr.GitCommand.OSCommand.CopyToClipboard(pullRequestURL)
}
func (pr *PullRequest) getPullRequestURL(branch *models.Branch) (string, error) {