summaryrefslogtreecommitdiff
path: root/Biz
diff options
context:
space:
mode:
Diffstat (limited to 'Biz')
-rwxr-xr-xBiz/Ide/hooks/pre-push55
1 files changed, 33 insertions, 22 deletions
diff --git a/Biz/Ide/hooks/pre-push b/Biz/Ide/hooks/pre-push
index 11c6bdc..85f047f 100755
--- a/Biz/Ide/hooks/pre-push
+++ b/Biz/Ide/hooks/pre-push
@@ -11,31 +11,42 @@
user=$(git config --get user.name)
mail=$(git config --get user.email)
##
- if lint "${BIZ_ROOT:?}"/**/*
- then
- lint_result="good"
- else
- lint_result="fail"
- fi
-##
- read -r -d '' note <<EOF
+ while read local_ref local_sha remote_ref remote_sha
+ do
+ commit=$(git notes --ref=ci show $local_ref || true)
+ if [[ -n "$commit" ]]
+ then
+ lint_ok=$(grep "Lint-is: good" <<< $commit)
+ test_ok=$(grep "Test-is: good" <<< $commit)
+ if [[ $lint_ok -eq 0 || $test_ok -eq 0 ]]
+ then
+ exit 0
+ fi
+ fi
+ ##
+ if lint "${BIZ_ROOT:?}"/**/*
+ then
+ lint_result="good"
+ else
+ lint_result="fail"
+ exit 1
+ fi
+ ##
+ if bild --test "${BIZ_ROOT:?}"/**/*
+ then
+ test_result="good"
+ else
+ test_result="fail"
+ exit 1
+ fi
+ ##
+ read -r -d '' note <<EOF
Lint-is: $lint_result
-Lint-by: $user <$mail>
-Lint-at: $at
-EOF
- git notes --ref=ci append -m "$note"
-##
- if bild --test "${BIZ_ROOT:?}"/**/*
- then
- test_result="good"
- else
- test_result="fail"
- fi
-##
- read -r -d '' note <<EOF
Test-is: $test_result
Test-by: $user <$mail>
Test-at: $at
EOF
- git notes --ref=ci append -m "$note"
+ ##
+ git notes --ref=ci append -m "$note"
+ done
##