From 21f4828eec06cde6b073001b6258594bb84f16a1 Mon Sep 17 00:00:00 2001 From: Joe Fleming Date: Wed, 22 Apr 2015 17:26:22 -0700 Subject: [PATCH] Fix github patch url Also make curl follow redirects in the future --- git/githelpers | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/git/githelpers b/git/githelpers index ca3894d..5098858 100644 --- a/git/githelpers +++ b/git/githelpers @@ -104,6 +104,7 @@ backport_pr() { REMOTE=$3 : ${REMOTE:=$DEFAULT_REMOTE} THISBRANCH=`git rev-parse --abbrev-ref HEAD` + URL="https://patch-diff.githubusercontent.com/raw/elastic/kibana/pull/${PR}.patch" if [ -z "$PR" ]; then echo "Please specify a PR to backport" @@ -111,7 +112,7 @@ backport_pr() { fi echo Backporting ${PR} to ${BRANCH} from ${REMOTE} - git checkout ${BRANCH} && git pull ${REMOTE} ${BRANCH} && curl -s "https://github.com/elastic/kibana/pull/${PR}.patch" | git am + git checkout ${BRANCH} && git pull ${REMOTE} ${BRANCH} && curl -L -s "$URL" | git am # if the backport couldn't be cleanly applied, tell the user and exit if [ $? -ne 0 ]; then