Currently if git merge-base fails we'll hide the error and exit with
exit status 0. Let's make we only exit early if git merge-base exits
with 1 which indicates the current commit is not on the target branch.
Any other error is considered fatal.
# If work is being done on the packaging rules in a separate branch, don't touch the checkout.
if ! git merge-base --is-ancestor HEAD "origin/$GIT_BRANCH"; then
- exit 0
+ EXIT_STATUS=$?
+ if [[ $EXIT_STATUS -eq 1 ]]; then
+ exit 0
+ else
+ exit $EXIT_STATUS
+ fi
fi
fi