From 521234f8c978ce001c82a364fae79732a5501624 Mon Sep 17 00:00:00 2001 From: Garry Yao Date: Sun, 30 Mar 2014 22:46:55 +0800 Subject: [PATCH] Fixed git status is broken on branch name containing forward-slash. --- gitstatus.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gitstatus.sh b/gitstatus.sh index 9a8c3c7..a8fe5a1 100755 --- a/gitstatus.sh +++ b/gitstatus.sh @@ -56,7 +56,7 @@ if [[ -z "$branch" ]]; then fi else remote_name=`git config branch.${branch}.remote` - + if [[ -n "$remote_name" ]]; then merge_name=`git config branch.${branch}.merge` else @@ -67,7 +67,7 @@ else if [[ "$remote_name" == '.' ]]; then remote_ref="$merge_name" else - remote_ref="refs/remotes/$remote_name/${merge_name##*/}" + remote_ref="refs/remotes/$remote_name/${merge_name##refs/heads/}" fi # get the revision list, and count the leading "<" and ">"