aboutsummaryrefslogtreecommitdiff
path: root/.githooks/pre-commit
blob: de1c2ce41f44e07974315d7361e73d9315d46422 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

set -e

git stash --keep-index --include-untracked --message "Pre-commit hook"

lintStageResult=0
dune build && dune runtest || lintStageResult=$?

git stash pop
if [ $lintStageResult -ne 0 ]; then
    echo "Test stage failed"
    exit 1
fi

git notes append -m "Built and tested with dune 
Reported-by: precommit hook"