This is an automated email from the ASF dual-hosted git repository.

mdrob pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/main by this push:
     new 7d92d39  Attempt to detect cherrypick remote if not specified (#569)
7d92d39 is described below

commit 7d92d397975486383b2b2dce7ef81950706b4519
Author: Mike Drob <[email protected]>
AuthorDate: Thu Jan 27 12:27:27 2022 -0600

    Attempt to detect cherrypick remote if not specified (#569)
---
 dev-tools/scripts/cherrypick.sh | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/dev-tools/scripts/cherrypick.sh b/dev-tools/scripts/cherrypick.sh
index e71ff45..b3902cc 100755
--- a/dev-tools/scripts/cherrypick.sh
+++ b/dev-tools/scripts/cherrypick.sh
@@ -196,15 +196,19 @@ for BRANCH in "${BRANCHES[@]}"; do
       LOG "WARN" "Cannot auto push if tests are disabled"
       exit 1
     fi
+    if [[ -z "$REMOTE" ]]; then
+      LOG "WARN" "Remote not specified, attempting to auto detect"
+      REMOTE=$(git config --get "branch.$BRANCH.remote")
+    fi
     LOG "INFO" "Pushing changes to $REMOTE/$BRANCH"
     # shellcheck disable=SC2086
     $GIT_COMMAND push $REMOTE $BRANCH
     if [ $? -gt 0 ]; then
-      LOG "WARN" "PUSH to $REMOTE/$BRANCH failed, please clean up an proceed 
manually"
+      LOG "WARN" "PUSH to $REMOTE/$BRANCH failed, please clean up and proceed 
manually"
       exit 2
     fi
     LOG "INFO" "Pushed $BRANCH to remote. Cherry-pick complete."
   fi
 done
 
-LOG "INFO" "SUCCESS on branches ${BRANCHES[*]} for commits ${COMMITS[*]}"
\ No newline at end of file
+LOG "INFO" "SUCCESS on branches ${BRANCHES[*]} for commits ${COMMITS[*]}"

Reply via email to