mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-12 12:55:47 +02:00
Merge pull request #2087 from xxdavid/bitbucket_custom_username
This commit is contained in:
commit
71a9389ca4
2 changed files with 14 additions and 2 deletions
|
@ -24,7 +24,10 @@ var bitbucketServiceDef = ServiceDefinition{
|
||||||
pullRequestURLIntoDefaultBranch: "/pull-requests/new?source={{.From}}&t=1",
|
pullRequestURLIntoDefaultBranch: "/pull-requests/new?source={{.From}}&t=1",
|
||||||
pullRequestURLIntoTargetBranch: "/pull-requests/new?source={{.From}}&dest={{.To}}&t=1",
|
pullRequestURLIntoTargetBranch: "/pull-requests/new?source={{.From}}&dest={{.To}}&t=1",
|
||||||
commitURL: "/commits/{{.CommitSha}}",
|
commitURL: "/commits/{{.CommitSha}}",
|
||||||
regexStrings: defaultUrlRegexStrings,
|
regexStrings: []string{
|
||||||
|
`^(?:https?|ssh)://.*/(?P<owner>.*)/(?P<repo>.*?)(?:\.git)?$`,
|
||||||
|
`^.*@.*:(?P<owner>.*)/(?P<repo>.*?)(?:\.git)?$`,
|
||||||
|
},
|
||||||
repoURLTemplate: defaultRepoURLTemplate,
|
repoURLTemplate: defaultRepoURLTemplate,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -115,6 +115,15 @@ func TestGetPullRequestURL(t *testing.T) {
|
||||||
assert.Equal(t, "https://gitlab.com/peter/public/calculator/merge_requests/new?merge_request[source_branch]=feature%2Fcommit-ui&merge_request[target_branch]=epic%2Fui", url)
|
assert.Equal(t, "https://gitlab.com/peter/public/calculator/merge_requests/new?merge_request[source_branch]=feature%2Fcommit-ui&merge_request[target_branch]=epic%2Fui", url)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
testName: "Opens a link to new pull request on bitbucket with a custom SSH username",
|
||||||
|
from: "feature/profile-page",
|
||||||
|
remoteUrl: "john@bitbucket.org:johndoe/social_network.git",
|
||||||
|
test: func(url string, err error) {
|
||||||
|
assert.NoError(t, err)
|
||||||
|
assert.Equal(t, "https://bitbucket.org/johndoe/social_network/pull-requests/new?source=feature%2Fprofile-page&t=1", url)
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
testName: "Opens a link to new pull request on Azure DevOps (SSH)",
|
testName: "Opens a link to new pull request on Azure DevOps (SSH)",
|
||||||
from: "feature/new",
|
from: "feature/new",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue