@@ -137,7 +137,7 @@ __git_ps1_show_upstream ()
137
137
svn_upstream=${svn_upstream[ ${#svn_upstream[@]} - 2 ]}
138
138
svn_upstream=${svn_upstream%@* }
139
139
local n_stop=" ${# svn_remote[@]} "
140
- for (( n= 1 ; n <= n_stop; ++ n )) ; do
140
+ for (( n= 1 ; n <= n_stop; n ++ )) ; do
141
141
svn_upstream=${svn_upstream# ${svn_remote[$n]} }
142
142
done
143
143
@@ -166,10 +166,8 @@ __git_ps1_show_upstream ()
166
166
for commit in $commits
167
167
do
168
168
case " $commit " in
169
- " <" * ) let ++behind
170
- ;;
171
- * ) let ++ahead
172
- ;;
169
+ " <" * ) (( behind++ )) ;;
170
+ * ) (( ahead++ )) ;;
173
171
esac
174
172
done
175
173
count=" $behind $ahead "
@@ -726,6 +724,9 @@ __git_complete_remote_or_refspec ()
726
724
{
727
725
local cur_=" $cur " cmd=" ${words[1]} "
728
726
local i c=2 remote=" " pfx=" " lhs=1 no_complete_refspec=0
727
+ if [ " $cmd " = " remote" ]; then
728
+ (( c++ ))
729
+ fi
729
730
while [ $c -lt $cword ]; do
730
731
i=" ${words[c]} "
731
732
case " $i " in
@@ -743,7 +744,7 @@ __git_complete_remote_or_refspec ()
743
744
-* ) ;;
744
745
* ) remote=" $i " ; break ;;
745
746
esac
746
- c= $(( ++ c ))
747
+ (( c ++ ))
747
748
done
748
749
if [ -z " $remote " ]; then
749
750
__gitcomp_nl " $( __git_remotes) "
@@ -776,7 +777,7 @@ __git_complete_remote_or_refspec ()
776
777
__gitcomp_nl " $( __git_refs) " " $pfx " " $cur_ "
777
778
fi
778
779
;;
779
- pull)
780
+ pull|remote )
780
781
if [ $lhs = 1 ]; then
781
782
__gitcomp_nl " $( __git_refs " $remote " ) " " $pfx " " $cur_ "
782
783
else
@@ -983,7 +984,7 @@ __git_find_on_cmdline ()
983
984
return
984
985
fi
985
986
done
986
- c= $(( ++ c ))
987
+ (( c ++ ))
987
988
done
988
989
}
989
990
@@ -994,7 +995,7 @@ __git_has_doubledash ()
994
995
if [ " --" = " ${words[c]} " ]; then
995
996
return 0
996
997
fi
997
- c= $(( ++ c ))
998
+ (( c ++ ))
998
999
done
999
1000
return 1
1000
1001
}
@@ -1117,7 +1118,7 @@ _git_branch ()
1117
1118
-d|-m) only_local_ref=" y" ;;
1118
1119
-r) has_r=" y" ;;
1119
1120
esac
1120
- c= $(( ++ c ))
1121
+ (( c ++ ))
1121
1122
done
1122
1123
1123
1124
case " $cur " in
@@ -2277,17 +2278,20 @@ _git_config ()
2277
2278
2278
2279
_git_remote ()
2279
2280
{
2280
- local subcommands=" add rename rm show prune update set-head "
2281
+ local subcommands=" add rename rm set-head set-branches set-url show prune update"
2281
2282
local subcommand=" $( __git_find_on_cmdline " $subcommands " ) "
2282
2283
if [ -z " $subcommand " ]; then
2283
2284
__gitcomp " $subcommands "
2284
2285
return
2285
2286
fi
2286
2287
2287
2288
case " $subcommand " in
2288
- rename|rm|show|prune)
2289
+ rename|rm|set-url| show|prune)
2289
2290
__gitcomp_nl " $( __git_remotes) "
2290
2291
;;
2292
+ set-head|set-branches)
2293
+ __git_complete_remote_or_refspec
2294
+ ;;
2291
2295
update)
2292
2296
local i c=' ' IFS=$' \n '
2293
2297
for i in $( git --git-dir=" $( __gitdir) " config --get-regexp " remotes\..*" 2> /dev/null) ; do
@@ -2568,7 +2572,7 @@ _git_tag ()
2568
2572
f=1
2569
2573
;;
2570
2574
esac
2571
- c= $(( ++ c ))
2575
+ (( c ++ ))
2572
2576
done
2573
2577
2574
2578
case " $prev " in
@@ -2621,7 +2625,7 @@ _git ()
2621
2625
--help) command=" help" ; break ;;
2622
2626
* ) command=" $i " ; break ;;
2623
2627
esac
2624
- c= $(( ++ c ))
2628
+ (( c ++ ))
2625
2629
done
2626
2630
2627
2631
if [ -z " $command " ]; then
0 commit comments