Skip to content

Commit 5587c43

Browse files
fix: skip commit and push when no changes compared to remote (#300)
1 parent b4b468c commit 5587c43

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

entrypoint.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,11 +248,9 @@ push_to_branch() {
248248
git checkout "${CHECKOUT}"
249249
fi
250250

251-
if [ -n "$(git show-ref refs/heads/${BRANCH})" ]; then
252-
git checkout "${BRANCH}"
253-
else
254-
git checkout -b "${BRANCH}"
255-
fi
251+
# Checkout localization branch, using remote state if available
252+
git fetch origin "${BRANCH}" 2>/dev/null || true
253+
git checkout -B "${BRANCH}" "origin/${BRANCH}" 2>/dev/null || git checkout -B "${BRANCH}"
256254

257255
git add .
258256

0 commit comments

Comments
 (0)