From 0b15620ea350e16d5fe5124497e4f3ca13caae52 Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Mon, 15 Oct 2018 21:05:23 -0400 Subject: [PATCH] tolerate both http(s) and git urls for cherry_pick_pull Looks like the previous change broke for users who have cloned their upstream using https instead of ssh. Here we explicit strip out the prefixes like "http://", "https://" and "git@" before look for the repo name and the org name. Change-Id: I8fbfae8bfa209a954d36d3ada791dcf13070ec6d --- hack/cherry_pick_pull.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hack/cherry_pick_pull.sh b/hack/cherry_pick_pull.sh index e7b440e2a3f..a744b7ae9eb 100755 --- a/hack/cherry_pick_pull.sh +++ b/hack/cherry_pick_pull.sh @@ -34,8 +34,8 @@ DRY_RUN=${DRY_RUN:-""} REGENERATE_DOCS=${REGENERATE_DOCS:-""} UPSTREAM_REMOTE=${UPSTREAM_REMOTE:-upstream} FORK_REMOTE=${FORK_REMOTE:-origin} -MAIN_REPO_ORG=${MAIN_REPO_ORG:-$(git remote get-url "$UPSTREAM_REMOTE" | awk -F'[@:./]' 'NR==1{print $4}')} -MAIN_REPO_NAME=${MAIN_REPO_NAME:-$(git remote get-url "$UPSTREAM_REMOTE" | awk -F'[@:./]' 'NR==1{print $5}')} +MAIN_REPO_ORG=${MAIN_REPO_ORG:-$(git remote get-url "$UPSTREAM_REMOTE" | awk '{gsub(/http[s]:\/\/|git@/,"")}1' | awk -F'[@:./]' 'NR==1{print $3}')} +MAIN_REPO_NAME=${MAIN_REPO_NAME:-$(git remote get-url "$UPSTREAM_REMOTE" | awk '{gsub(/http[s]:\/\/|git@/,"")}1' | awk -F'[@:./]' 'NR==1{print $4}')} if [[ -z ${GITHUB_USER:-} ]]; then echo "Please export GITHUB_USER= (or GH organization, if that's where your fork lives)"