diff --git a/gis b/gis index 5405741..d01598e 100755 --- a/gis +++ b/gis @@ -183,7 +183,7 @@ for dir in "${git_dirs[@]}"; do # Get origin head if git symbolic-ref refs/remotes/origin/HEAD > /dev/null 2>&1; then - [[ $(git symbolic-ref refs/remotes/origin/HEAD) =~ \/([^\/]*)$ ]] &>/dev/null && origin_head="${BASH_REMATCH[1]}" + [[ $(git symbolic-ref refs/remotes/origin/HEAD) =~ refs/remotes/origin/(.*)$ ]] &>/dev/null && origin_head="${BASH_REMATCH[1]}" else origin_head="$current_branch" fi @@ -248,7 +248,7 @@ for dir in "${git_dirs[@]}"; do fi if [ "$current_branch" != "$origin_head" ]; then num_additional_branches=$(( num_additional_branches - 1 )) - output="${output} (${origin_head}${text_reset})" + output="${output} (${origin_head})" fi if [[ $num_additional_branches -gt 0 ]]; then output="${output} (+${num_additional_branches})"