aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2021-11-01 11:11:53 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2021-11-03 15:06:59 +0530
commit494cb5fc4fbe90d7a4b27e1d1114cb20840883d3 (patch)
tree692edaead3d7d0625c397e44f18e1dfd61ad9ad0 /scripts
parent26f99a254f2c858e7b6df7c8c4e321c56675038d (diff)
scripts/pre-push-hook: skip checks when deleting a branch
Diffstat (limited to 'scripts')
-rw-r--r--scripts/pre-push-hook.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/pre-push-hook.sh b/scripts/pre-push-hook.sh
index 78dafecb..e9b29f92 100644
--- a/scripts/pre-push-hook.sh
+++ b/scripts/pre-push-hook.sh
@@ -4,6 +4,11 @@ set -e
set -u
set -o pipefail
+ZERO=$(git hash-object --stdin </dev/null | tr '[0-9a-f]' '0')
GRADLE_EXEC="${GRADLE_EXEC:-./gradlew}"
-"${GRADLE_EXEC}" spotlessCheck apiCheck
+while read local_ref local_oid remote_ref remote_oid; do
+ if [ "${local_oid}" != "${ZERO}" ]; then
+ "${GRADLE_EXEC}" spotlessCheck apiCheck
+ fi
+done