File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 60
60
# of values:
61
61
#
62
62
# verbose show number of commits ahead/behind (+/-) upstream
63
+ # name if verbose, then also show the upstream abbrev name
63
64
# legacy don't use the '--count' option available in recent
64
65
# versions of git-rev-list
65
66
# git always compare HEAD to @{upstream}
@@ -94,7 +95,7 @@ __git_ps1_show_upstream ()
94
95
{
95
96
local key value
96
97
local svn_remote svn_url_pattern count n
97
- local upstream=git legacy=" " verbose=" "
98
+ local upstream=git legacy=" " verbose=" " name= " "
98
99
99
100
svn_remote=()
100
101
# get some config options from git-config
@@ -122,6 +123,7 @@ __git_ps1_show_upstream ()
122
123
git|svn) upstream=" $option " ;;
123
124
verbose) verbose=1 ;;
124
125
legacy) legacy=1 ;;
126
+ name) name=1 ;;
125
127
esac
126
128
done
127
129
@@ -204,6 +206,9 @@ __git_ps1_show_upstream ()
204
206
* ) # diverged from upstream
205
207
p=" u+${count#* } -${count% * } " ;;
206
208
esac
209
+ if [[ -n " $count " && -n " $name " ]]; then
210
+ p=" $p $( git rev-parse --abbrev-ref " $upstream " 2> /dev/null) "
211
+ fi
207
212
fi
208
213
209
214
}
You can’t perform that action at this time.
0 commit comments