@@ -30,7 +30,7 @@ cdfail() {
3030}
3131
3232# add another workspace to global git config
33- function addworkspace {
33+ addworkspace () {
3434 git config --global bulkworkspaces." $wsname " " $wsdir " ;
3535 if [ -n " $source " ]; then
3636 if [ ! -d " $wsdir " ]; then echo 1>&2 " Path of workspace doesn't exist, make it first." ; exit 1; fi
@@ -59,19 +59,19 @@ function addworkspace {
5959}
6060
6161# add current directory
62- function addcurrent { git config --global bulkworkspaces." $wsname " " $PWD " ; }
62+ addcurrent () { git config --global bulkworkspaces." $wsname " " $PWD " ; }
6363
6464# remove workspace from global git config
65- function removeworkspace { checkWSName && git config --global --unset bulkworkspaces." $wsname " ; }
65+ removeworkspace () { checkWSName && git config --global --unset bulkworkspaces." $wsname " ; }
6666
6767# remove workspace from global git config
68- function purge { git config --global --remove-section bulkworkspaces; }
68+ purge () { git config --global --remove-section bulkworkspaces; }
6969
7070# list all current workspace locations defined
71- function listall { git config --global --get-regexp bulkworkspaces; }
71+ listall () { git config --global --get-regexp bulkworkspaces; }
7272
7373# guarded execution of a git command in one specific repository
74- function guardedExecution () {
74+ guardedExecution () {
7575 if [ " ${quiet?} " != " true" ] || $guardedmode ; then
7676 echo 1>&2 " ${bldred} ->${reset} executing ${inverse} git $gitcommand ${reset} in repository ${leadingpath%/* } /${bldred}${curdir##*/ }${reset} "
7777 fi
@@ -88,7 +88,7 @@ function guardedExecution () {
8888}
8989
9090# check if the passed command is known as a core git command
91- function checkGitCommand () {
91+ checkGitCommand () {
9292 if git help -a | grep -o -q " \b${corecommand} \b" ; then
9393 echo 1>&2 " Core command \" $corecommand \" accepted."
9494 else
@@ -101,7 +101,7 @@ function checkGitCommand () {
101101}
102102
103103# check if workspace name is registered
104- function checkWSName () {
104+ checkWSName () {
105105 while read -r workspace; do
106106 parseWsName " $workspace "
107107 if [[ $rwsname == " $wsname " ]]; then return ; fi
@@ -111,7 +111,7 @@ function checkWSName () {
111111}
112112
113113# parse out wsname from workspacespec
114- function parseWsName () {
114+ parseWsName () {
115115 local wsspec=" $1 "
116116 # Get the workspace value from its specification in the `.gitconfig`.
117117 # May be an absolute path or a variable name of the form: `$VARNAME`
@@ -128,7 +128,7 @@ function parseWsName () {
128128}
129129
130130# detects the wsname of the current directory
131- function wsnameToCurrent () {
131+ wsnameToCurrent () {
132132 while read -r workspace; do
133133 if [ -z " $workspace " ]; then continue ; fi
134134 parseWsName " $workspace "
@@ -140,15 +140,15 @@ function wsnameToCurrent () {
140140}
141141
142142# helper to check number of arguments.
143- function allowedargcount () {
143+ allowedargcount () {
144144 if [ " $paramcount " -ne " ${1:- 0} " ] && [ " $paramcount " -ne " ${2:- 0} " ]; then
145145 echo 1>&2 " error: wrong number of arguments" && usage;
146146 exit 1;
147147 fi
148148}
149149
150150# execute the bulk operation
151- function executBulkOp () {
151+ executBulkOp () {
152152 checkGitCommand
153153 if ! $allwsmode && ! $singlemode ; then wsnameToCurrent; fi # by default git bulk works within the 'current' workspace
154154 listall | while read -r workspacespec; do
@@ -194,7 +194,7 @@ while [ "${#}" -ge 1 ] ; do
194194 --listall|--purge)
195195 butilcommand=" ${1: 2} " && break ;;
196196 --removeworkspace|--addcurrent|--addworkspace)
197- butilcommand=" ${1: 2} " && wsname=" $2 " && wsdir=" $3 " && if [ " $4 " == " --from" ]; then source=" $5 " ; fi && break ;;
197+ butilcommand=" ${1: 2} " && wsname=" $2 " && wsdir=" $3 " && if [ " $4 " = " --from" ]; then source=" $5 " ; fi && break ;;
198198 --no-follow-symlinks)
199199 no_follow_symlinks=true ;;
200200 --no-follow-hidden)
0 commit comments