@@ -115,7 +115,7 @@ __git_ps1_show_upstream ()
115
115
{
116
116
local key value
117
117
local svn_remote svn_url_pattern count n
118
- local upstream =git legacy=" " verbose=" " name=" "
118
+ local upstream_type =git legacy=" " verbose=" " name=" "
119
119
120
120
svn_remote=()
121
121
# get some config options from git-config
@@ -132,7 +132,7 @@ __git_ps1_show_upstream ()
132
132
svn-remote.* .url)
133
133
svn_remote[$(( ${# svn_remote[@]} + 1 )) ]=" $value "
134
134
svn_url_pattern=" $svn_url_pattern \\ |$value "
135
- upstream =svn+git # default upstream is SVN if available, else git
135
+ upstream_type =svn+git # default upstream type is SVN if available, else git
136
136
;;
137
137
esac
138
138
done <<< " $output"
@@ -141,16 +141,16 @@ __git_ps1_show_upstream ()
141
141
local option
142
142
for option in ${GIT_PS1_SHOWUPSTREAM} ; do
143
143
case " $option " in
144
- git|svn) upstream =" $option " ;;
144
+ git|svn) upstream_type =" $option " ;;
145
145
verbose) verbose=1 ;;
146
146
legacy) legacy=1 ;;
147
147
name) name=1 ;;
148
148
esac
149
149
done
150
150
151
- # Find our upstream
152
- case " $upstream " in
153
- git) upstream =" @{upstream}" ;;
151
+ # Find our upstream type
152
+ case " $upstream_type " in
153
+ git) upstream_type =" @{upstream}" ;;
154
154
svn* )
155
155
# get the upstream from the "git-svn-id: ..." in a commit message
156
156
# (git-svn uses essentially the same procedure internally)
@@ -167,24 +167,24 @@ __git_ps1_show_upstream ()
167
167
168
168
if [[ -z " $svn_upstream " ]]; then
169
169
# default branch name for checkouts with no layout:
170
- upstream =${GIT_SVN_ID:- git-svn}
170
+ upstream_type =${GIT_SVN_ID:- git-svn}
171
171
else
172
- upstream =${svn_upstream#/ }
172
+ upstream_type =${svn_upstream#/ }
173
173
fi
174
- elif [[ " svn+git" = " $upstream " ]]; then
175
- upstream =" @{upstream}"
174
+ elif [[ " svn+git" = " $upstream_type " ]]; then
175
+ upstream_type =" @{upstream}"
176
176
fi
177
177
;;
178
178
esac
179
179
180
180
# Find how many commits we are ahead/behind our upstream
181
181
if [[ -z " $legacy " ]]; then
182
182
count=" $( git rev-list --count --left-right \
183
- " $upstream " ...HEAD 2> /dev/null) "
183
+ " $upstream_type " ...HEAD 2> /dev/null) "
184
184
else
185
185
# produce equivalent output to --count for older versions of git
186
186
local commits
187
- if commits=" $( git rev-list --left-right " $upstream " ...HEAD 2> /dev/null) "
187
+ if commits=" $( git rev-list --left-right " $upstream_type " ...HEAD 2> /dev/null) "
188
188
then
189
189
local commit behind=0 ahead=0
190
190
for commit in $commits
@@ -229,7 +229,7 @@ __git_ps1_show_upstream ()
229
229
esac
230
230
if [[ -n " $count " && -n " $name " ]]; then
231
231
__git_ps1_upstream_name=$( git rev-parse \
232
- --abbrev-ref " $upstream " 2> /dev/null)
232
+ --abbrev-ref " $upstream_type " 2> /dev/null)
233
233
if [ $pcmode = yes ] && [ $ps1_expanded = yes ]; then
234
234
p=" $p \$ {__git_ps1_upstream_name}"
235
235
else
0 commit comments