mirror of
https://github.com/unisonweb/unison.git
synced 2024-11-11 06:05:12 +03:00
19 lines
473 B
Bash
Executable File
19 lines
473 B
Bash
Executable File
#!/bin/bash
|
|
# Run the following command in the root of your project to install this pre-push hook:
|
|
# cp git-hooks/pre-push .git/hooks/pre-push; chmod 700 .git/hooks/pre-push
|
|
|
|
# Check if we actually have commits to push
|
|
commits=`git log @{u}..`
|
|
if [ -z "$commits" ]; then
|
|
exit 0
|
|
fi
|
|
|
|
CMD="./scripts/test.sh"
|
|
eval $CMD
|
|
RESULT=$?
|
|
if [ $RESULT -ne 0 ]; then
|
|
echo "The git push operation was canceled because \`$CMD\` did not complete successfully."
|
|
exit 1
|
|
fi
|
|
exit 0
|