@@ -84,8 +84,10 @@ shift 1
84
84
declare -r PULLS=( " $@ " )
85
85
86
86
function join { local IFS=" $1 " ; shift ; echo " $* " ; }
87
- declare -r PULLDASH=$( join - " ${PULLS[@]/#/# } " ) # Generates something like "#12345-#56789"
88
- declare -r PULLSUBJ=$( join " " " ${PULLS[@]/#/# } " ) # Generates something like "#12345 #56789"
87
+ PULLDASH=$( join - " ${PULLS[@]/#/# } " ) # Generates something like "#12345-#56789"
88
+ declare -r PULLDASH
89
+ PULLSUBJ=$( join " " " ${PULLS[@]/#/# } " ) # Generates something like "#12345 #56789"
90
+ declare -r PULLSUBJ
89
91
90
92
echo " +++ Updating remotes..."
91
93
git remote update " ${UPSTREAM_REMOTE} " " ${FORK_REMOTE} "
@@ -96,9 +98,12 @@ if ! git log -n1 --format=%H "${BRANCH}" >/dev/null 2>&1; then
96
98
exit 1
97
99
fi
98
100
99
- declare -r NEWBRANCHREQ=" automated-cherry-pick-of-${PULLDASH} " # "Required" portion for tools.
100
- declare -r NEWBRANCH=" $( echo " ${NEWBRANCHREQ} -${BRANCH} " | sed ' s/\//-/g' ) "
101
- declare -r NEWBRANCHUNIQ=" ${NEWBRANCH} -$( date +%s) "
101
+ NEWBRANCHREQ=" automated-cherry-pick-of-${PULLDASH} " # "Required" portion for tools.
102
+ declare -r NEWBRANCHREQ
103
+ NEWBRANCH=" $( echo " ${NEWBRANCHREQ} -${BRANCH} " | sed ' s/\//-/g' ) "
104
+ declare -r NEWBRANCH
105
+ NEWBRANCHUNIQ=" ${NEWBRANCH} -$( date +%s) "
106
+ declare -r NEWBRANCHUNIQ
102
107
echo " +++ Creating local branch ${NEWBRANCHUNIQ} "
103
108
104
109
cleanbranch=" "
@@ -128,7 +133,8 @@ trap return_to_kansas EXIT
128
133
129
134
SUBJECTS=()
130
135
function make-a-pr() {
131
- local rel=" $( basename " ${BRANCH} " ) "
136
+ local rel
137
+ rel=" $( basename " ${BRANCH} " ) "
132
138
echo
133
139
echo " +++ Creating a pull request on GitHub at ${GITHUB_USER} :${NEWBRANCH} "
134
140
@@ -137,7 +143,8 @@ function make-a-pr() {
137
143
# when we shove the heredoc at hub directly, tickling the ioctl
138
144
# crash.
139
145
prtext=" $( mktemp -t prtext.XXXX) " # cleaned in return_to_kansas
140
- local numandtitle=$( printf ' %s\n' " ${SUBJECTS[@]} " )
146
+ local numandtitle
147
+ numandtitle=$( printf ' %s\n' " ${SUBJECTS[@]} " )
141
148
cat > " ${prtext} " << EOF
142
149
Automated cherry pick of ${numandtitle}
143
150
@@ -218,7 +225,7 @@ if [[ -n "${DRY_RUN}" ]]; then
218
225
exit 0
219
226
fi
220
227
221
- if git remote -v | grep ^${FORK_REMOTE} | grep ${MAIN_REPO_ORG} /${MAIN_REPO_NAME} .git; then
228
+ if git remote -v | grep ^" ${FORK_REMOTE} " | grep " ${MAIN_REPO_ORG} /${MAIN_REPO_NAME} .git" ; then
222
229
echo " !!! You have ${FORK_REMOTE} configured as your ${MAIN_REPO_ORG} /${MAIN_REPO_NAME} .git"
223
230
echo " This isn't normal. Leaving you with push instructions:"
224
231
echo
0 commit comments