Skip to content

Commit b1055ff

Browse files
committed
[LTRM] Shell Check changes
1 parent 40dff86 commit b1055ff

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

lt_rebase_merge.sh

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,30 @@ if [ -z "$PR_BRANCH" ] || [ -z "$TARGET_BRANCH" ]; then
1212
fi
1313

1414
# Check if all branches exist
15-
git show-ref --verify --quiet refs/heads/$PR_BRANCH
15+
git show-ref --verify --quiet refs/heads/"${PR_BRANCH}"
1616
if [ $? -ne 0 ]; then
1717
echo "Branch ${PR_BRANCH} does not exist."
1818
exit 1
1919
fi
2020

21-
git show-ref --verify --quiet refs/heads/$TARGET_BRANCH
21+
git show-ref --verify --quiet refs/heads/"${TARGET_BRANCH}"
2222
if [ $? -ne 0 ]; then
2323
echo "Branch ${TARGET_BRANCH} does not exist."
2424
exit 1
2525
fi
2626

27-
git show-ref --verify --quiet refs/heads/$NEXT_BRANCH
27+
git show-ref --verify --quiet refs/heads/"${NEXT_BRANCH}"
2828
if [ $? -ne 0 ] ; then
2929
echo "Branch ${NEXT_BRANCH} does not exist."
3030
exit 1
3131
fi
3232

3333

3434
#collect all static data fire before making alterations to the local and remote repositories
35-
PAST_VERSION=$(git describe --tags --abbrev=0 $TARGET_BRANCH | awk -F '-' '{print $2}')
35+
PAST_VERSION=$(git describe --tags --abbrev=0 "${TARGET_BRANCH}" | awk -F '-' '{print $2}')
3636
if [ -z "$PAST_VERSION" ]; then
3737
echo "Failed to get a CIQ Tag from ${TARGET_BRANCH}."
38-
echo "LastTag: $(git describe --tags --abbrev=0 $TARGET_BRANCH)"
38+
echo "LastTag: $(git describe --tags --abbrev=0 "${TARGET_BRANCH}")"
3939
exit 1
4040
fi
4141
# Check if PAST_VERSION matches the regex
@@ -48,10 +48,10 @@ PAST_VERSION_BRANCH="ciq-${PAST_VERSION}"
4848
echo "PAST_VERSION: $PAST_VERSION"
4949
echo "PAST_VERSION_BRANCH: $PAST_VERSION_BRANCH"
5050

51-
NEW_GKH_TAG=$(git describe --tags --abbrev=0 $PR_BRANCH | sed 's/^.//g')
51+
NEW_GKH_TAG=$(git describe --tags --abbrev=0 "${PR_BRANCH}" | sed 's/^.//g')
5252
if [ -z "$NEW_GKH_TAG" ]; then
5353
echo "Failed to get a GKH Tag from ${PR_BRANCH}."
54-
echo "LastTag: $(git describe --tags --abbrev=0 $PR_BRANCH)"
54+
echo "LastTag: $(git describe --tags --abbrev=0 "${PR_BRANCH}")"
5555
exit 1
5656
fi
5757
# Check if NEW_GKH_TAG matches the regex
@@ -78,28 +78,28 @@ echo "git tag $NEW_CIQ_TAG $TARGET_BRANCH"
7878
echo "git push origin $NEW_CIQ_TAG"
7979

8080
echo "git checkout $NEXT_BRANCH"
81-
git checkout $NEXT_BRANCH
81+
git checkout "${NEXT_BRANCH}"
8282
if [ $? -ne 0 ]; then
8383
echo "Failed to checkout ${NEXT_BRANCH}."
8484
exit 1
8585
fi
8686

8787
echo "git pull origin $NEXT_BRANCH"
88-
git pull origin $NEXT_BRANCH
88+
git pull origin "${NEXT_BRANCH}"
8989
if [ $? -ne 0 ]; then
9090
echo "Failed to pull ${NEXT_BRANCH}."
9191
exit 1
9292
fi
9393

94-
echo "git merge --ff-only $PR_BRANCH"
95-
git merge --ff-only $PR_BRANCH
94+
echo "git merge --ff-only ${PR_BRANCH}"
95+
git merge --ff-only "${PR_BRANCH}"
9696
if [ $? -ne 0 ]; then
9797
echo "Failed to merge ${PR_BRANCH} into ${NEXT_BRANCH}."
9898
exit 1
9999
fi
100100

101101
echo "git push origin $NEXT_BRANCH"
102-
git push origin $NEXT_BRANCH
102+
git push origin "${NEXT_BRANCH}"
103103
if [ $? -ne 0 ]; then
104104
echo "Failed to push ${NEXT_BRANCH}."
105105
exit 1
@@ -115,56 +115,56 @@ fi
115115

116116

117117
echo "git branch -m $TARGET_BRANCH $PAST_VERSION_BRANCH"
118-
git branch -m $TARGET_BRANCH $PAST_VERSION_BRANCH
118+
git branch -m "${TARGET_BRANCH}" "${PAST_VERSION_BRANCH}"
119119
if [ $? -ne 0 ]; then
120120
echo "Failed to rename ${TARGET_BRANCH} to ${PAST_VERSION_BRANCH}."
121121
exit 1
122122
fi
123123

124124
echo "git push origin :$TARGET_BRANCH $PAST_VERSION_BRANCH"
125-
git push origin :$TARGET_BRANCH $PAST_VERSION_BRANCH
125+
git push origin :"${TARGET_BRANCH}" "${PAST_VERSION_BRANCH}"
126126
if [ $? -ne 0 ]; then
127127
echo "Failed to delete ${TARGET_BRANCH}."
128128
exit 1
129129
fi
130130

131131
echo "git push origin -u $PAST_VERSION_BRANCH"
132-
git push origin -u $PAST_VERSION_BRANCH
132+
git push origin -u "${PAST_VERSION_BRANCH}"
133133
if [ $? -ne 0 ]; then
134134
echo "Failed to push ${PAST_VERSION_BRANCH}."
135135
exit 1
136136
fi
137137

138138
echo "git branch -m $NEXT_BRANCH $TARGET_BRANCH"
139-
git branch -m $NEXT_BRANCH $TARGET_BRANCH
139+
git branch -m "${NEXT_BRANCH}" "${TARGET_BRANCH}"
140140
if [ $? -ne 0 ]; then
141141
echo "Failed to rename ${NEXT_BRANCH} to ${TARGET_BRANCH}."
142142
exit 1
143143
fi
144144

145145
echo "git push origin :$NEXT_BRANCH $TARGET_BRANCH"
146-
git push origin :$NEXT_BRANCH $TARGET_BRANCH
146+
git push origin :"${NEXT_BRANCH}" "${TARGET_BRANCH}"
147147
if [ $? -ne 0 ]; then
148148
echo "Failed to delete ${NEXT_BRANCH}."
149149
exit 1
150150
fi
151151

152152
echo "git push origin -u $TARGET_BRANCH"
153-
git push origin -u $TARGET_BRANCH
153+
git push origin -u "${TARGET_BRANCH}"
154154
if [ $? -ne 0 ]; then
155155
echo "Failed to push ${TARGET_BRANCH}."
156156
exit 1
157157
fi
158158

159159
echo "git tag $NEW_CIQ_TAG $TARGET_BRANCH"
160-
git tag $NEW_CIQ_TAG $TARGET_BRANCH
160+
git tag "${NEW_CIQ_TAG}" "${TARGET_BRANCH}"
161161
if [ $? -ne 0 ]; then
162162
echo "Failed to tag ${TARGET_BRANCH} with ${NEW_CIQ_TAG}."
163163
exit 1
164164
fi
165165

166166
echo "git push origin $NEW_CIQ_TAG"
167-
git push origin $NEW_CIQ_TAG
167+
git push origin "${NEW_CIQ_TAG}"
168168
if [ $? -ne 0 ]; then
169169
echo "Failed to push ${NEW_CIQ_TAG}."
170170
exit 1

0 commit comments

Comments
 (0)