Update merge-upstream-pull-request.sh

This commit is contained in:
LetterJay
2017-09-05 20:11:43 -05:00
committed by GitHub
parent ef79e47884
commit 4c6585de7a

View File

@@ -69,9 +69,10 @@ git checkout -b "$BASE_BRANCH_NAME$1"
readonly MERGE_SHA=$(curl --silent "$BASE_PULL_URL/$1" | jq '.merge_commit_sha' -r)
# Get the commits
readonly COMMITS=$(curl "$BASE_PULL_URL/$1/commits" | jq '.[].sha' -r)
readonly COMMITS=$(curl --silent "$BASE_PULL_URL/$1/commits" | jq '.[].sha' -r)
# Cherry pick onto the new branch
echo "Cherry picking onto branch"
CHERRY_PICK_OUTPUT=$(git cherry-pick -m 1 "$MERGE_SHA" 2>&1)
echo "$CHERRY_PICK_OUTPUT"
@@ -94,14 +95,16 @@ if echo "$CHERRY_PICK_OUTPUT" | grep -i 'error: mainline was specified but commi
git add -A .
git cherry-pick --continue
fi
else
# Add all files onto this branch
echo "Adding files to branch:"
git add -A .
fi
# Commit these changes
echo "Commiting changes"
git commit --allow-empty -m "$2"
# Push them onto the branch
echo "Pushing changes"
git push -u origin "$BASE_BRANCH_NAME$1"