+ISORT_UNSUPPORTED_BRANCH_REGEX='.*(stable-1\.5|stable-2\.0)$'
+
+if [[ ! ${GIT_BRANCH:-} =~ $ISORT_UNSUPPORTED_BRANCH_REGEX ]] && \
+ [[ ! ${GERRIT_BRANCH:-} =~ $ISORT_UNSUPPORTED_BRANCH_REGEX ]]; then
+ isort . --diff --check | tee ../../isort.out || exit_code=1
+else
+ echo "isort is not supported on the 'stable-2.0' branch" > ../../isort.out
+fi
+