Skip to content

Commit

Permalink
repo() branch paths fixed
Browse files Browse the repository at this point in the history
BitBucket has a different path for it's branches, so added a check. Works for github and bitbucket everywhere I've used.
  • Loading branch information
mclark4386 committed Mar 25, 2016
1 parent 6b0303d commit 6f0293d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .functions
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,11 @@ repo() {
local giturl="http:${giturl}"

if [[ $gitbranch != "master" ]]; then
local giturl="${giturl}/tree/${gitbranch}"
if echo "${giturl}" | grep -i "bitbucket" > /dev/null ; then
local giturl="${giturl}/branch/${gitbranch}"
else
local giturl="${giturl}/tree/${gitbranch}"
fi
fi

echo $giturl
Expand Down

0 comments on commit 6f0293d

Please sign in to comment.