Update commit-and-push.sh (#2640)

This commit is contained in:
Mika Ayenson
2023-03-09 17:31:19 -05:00
committed by GitHub
parent 40eff15fbe
commit 87c66f923e
-12
View File
@@ -7,21 +7,9 @@ TARGET_BRANCH=$1
COMMIT_SHA=$2
echo "Backporting from commit ${COMMIT_SHA} on branch ${TARGET_BRANCH}"
echo "Stashing changes"
git stash
echo "Checking out target branch"
git checkout ${TARGET_BRANCH}
echo "Applying new changes"
(git stash apply --quiet) || true
echo "Selecting incoming changes to be committed"
git checkout --theirs . --quiet
echo "Track new changes"
git add -A
NEEDS_BACKPORT=$(git diff HEAD --quiet --exit-code && echo n || echo y)
if [ "n" = "$NEEDS_BACKPORT" ]