#!/bin/bash # Tests the "preupload and predcommit hooks" functionality, which lets you run # hooks by installing a script into .git/hooks/pre-cl-* first. set -e . ./test-lib.sh setup_initsvn setup_gitsvn setup_hooks() { upload_retval=$1 dcommit_retval=$2 echo > PRESUBMIT.py <> test git add test; git commit -q -m "work" # Verify git cl upload fails. test_expect_failure "git-cl upload hook fails" "$GIT_CL upload master" # Verify git cl dcommit fails. test_expect_failure "git-cl dcommit hook fails" "$GIT_CL dcommit master" ) SUCCESS=$? #cleanup if [ $SUCCESS == 0 ]; then echo PASS fi