Skip to content

Commit d049d44

Browse files
authored
Merge pull request #114 from Jaxwood/master
Fix bug with open -i on default VSTS project repo
2 parents d9b9580 + aea6e3e commit d049d44

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

git-open

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@ elif [[ "${#pathargs[@]}" -ge '2' && ${pathargs[${#pathargs[@]} - 2]} == '_git'
189189
if (( is_issue )); then
190190
# Switch to workitems, provide work item id if specified
191191
urlpath="${urlpath%%/_git/*}/_workitems"
192+
# Handle case for the default repository url
193+
urlpath="${urlpath#_git\/*}"
192194
providerBranchRef="?id=${branch//[^0-9]/}"
193195
else
194196
# Keep project and repository name, append branch selector.

test/git-open.bats

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,13 @@ setup() {
496496
assert_output "http://tfs.example.com:8080/Project/Folder/_workitems?id=36"
497497
}
498498

499+
@test "vsts: default project repository - issue" {
500+
git remote set-url origin "https://gitopen.visualstudio.com/_git/Project"
501+
git checkout -B "bugfix-36"
502+
run ../git-open "--issue"
503+
assert_output "https://gitopen.visualstudio.com/Project/_workitems?id=36"
504+
}
505+
499506

500507
teardown() {
501508
cd ..

0 commit comments

Comments
 (0)