mirror of
https://github.com/paulirish/git-open.git
synced 2026-09-10 07:26:15 -04:00
gitlab: fix issue ID parsing (#183)
This commit is contained in:
parent
0296983a28
commit
8ac94bf7c3
3
git-open
3
git-open
|
|
@ -177,7 +177,8 @@ IFS='/' read -r -a pathargs <<<"$urlpath"
|
|||
|
||||
if (( is_issue )); then
|
||||
# For issues, take the numbers and preprend 'issues/'
|
||||
providerBranchRef="/issues/${remote_ref//[^0-9]/}"
|
||||
[[ $remote_ref =~ [0-9]+ ]]
|
||||
providerBranchRef="/issues/${BASH_REMATCH[0]}"
|
||||
else
|
||||
# Make # and % characters url friendly
|
||||
# github.com/paulirish/git-open/pull/24
|
||||
|
|
|
|||
|
|
@ -522,6 +522,13 @@ setup() {
|
|||
assert_output "https://git.example.com:7000/XXX/YYY"
|
||||
}
|
||||
|
||||
@test "gitlab: issue" {
|
||||
git remote set-url origin "git@gitlab.example.com:user/repo"
|
||||
git checkout -B "10-bump-up-to-v2.0"
|
||||
run ../git-open "--issue"
|
||||
assert_output "https://gitlab.example.com/user/repo/issues/10"
|
||||
}
|
||||
|
||||
##
|
||||
## Visual Studio Team Services
|
||||
##
|
||||
|
|
|
|||
Loading…
Reference in a new issue