From 6f0293da7fcf7f70e971193a0fef6d6b16cabe36 Mon Sep 17 00:00:00 2001 From: Matthew Clark Date: Fri, 25 Mar 2016 11:28:58 -0500 Subject: [PATCH] repo() branch paths fixed BitBucket has a different path for it's branches, so added a check. Works for github and bitbucket everywhere I've used. --- .functions | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.functions b/.functions index 8a0b37cfc..ebc7d7af4 100644 --- a/.functions +++ b/.functions @@ -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