aboutsummaryrefslogtreecommitdiff
path: root/scripts/pre-push-hook.sh
blob: e9b29f92d7642037a80b7bb2c223f414b871502c (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env bash

set -e
set -u
set -o pipefail

ZERO=$(git hash-object --stdin </dev/null | tr '[0-9a-f]' '0')
GRADLE_EXEC="${GRADLE_EXEC:-./gradlew}"

while read local_ref local_oid remote_ref remote_oid; do
  if [ "${local_oid}" != "${ZERO}" ]; then
    "${GRADLE_EXEC}" spotlessCheck apiCheck
  fi
done