aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Zapolskiy <vladimir.zapolskiy@linaro.org>2023-02-02 23:38:29 +0200
committerDaniel Lezcano <daniel.lezcano@linaro.org>2023-02-02 23:12:57 +0100
commit1de1b457449ac2be4872510a4d2668b00c3a45c0 (patch)
treefa4ae479af5940ac3f4257f361ae607e150313a0
parent2c0a8311f9741ce209722499b6af47925319f916 (diff)
ci-merge: fix a problem of not merged remote into integration branch
If there are two remotes and one of their remote names matches another one as a regexp pattern, then it will not be added as a new remote. This condition is met, when one remote name is a substring of another, and it may result in a missing merge of a remote branch. The problem is encountered by me, but the fix is attributed to Dmitry Baryshkov. Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
-rwxr-xr-xci-merge2
1 files changed, 1 insertions, 1 deletions
diff --git a/ci-merge b/ci-merge
index 7704f5b..d59821f 100755
--- a/ci-merge
+++ b/ci-merge
@@ -489,7 +489,7 @@ do_add_new() {
REMOTE_URL=$(echo $LINE | awk '{print $2}')
REMOTE_BRANCH=$(echo $LINE | awk '{print $3}')
- git remote | grep -q "$REMOTE_NAME"
+ git remote | grep -q "^$REMOTE_NAME$"
if [ $? -ne 0 ]; then
echo "Adding remote $REMOTE_NAME $REMOTE_URL $REMOTE_BRANCH"
git remote add -f -t $REMOTE_BRANCH $REMOTE_NAME $REMOTE_URL