#!/bin/bash -e

# Fix drift between moodle.git and AMOS
# Sometimes, the English string changes are not parsed correctly (due to non-linearity of Git commits).
# This job checks for differences between the Git and AMOS repositories.
# On detected drift, the status is set to UNSTABLE and e-mail is sent. The drift is then automatically
# fixed so the next execution shoudl be stable again.
# upstream: en-track
# downstream: en-mergefix

php $AMOSCLIROOT/fix-drift.php --execute

# Run it once again - this is to handle special cases such as string added to
# security only branches like 3.5, 3.8, 3.9. In that case, AMOS would see
# string disappear from 3.6+, so the second run will find it again at 3.8+.
php $AMOSCLIROOT/fix-drift.php --execute
