OLD | NEW |
(Empty) | |
| 1 #!/bin/bash |
| 2 |
| 3 # Tests the "preupload and predcommit hooks" functionality, which lets you run |
| 4 # hooks by installing a script into .git/hooks/pre-cl-* first. |
| 5 |
| 6 set -e |
| 7 |
| 8 . ./test-lib.sh |
| 9 |
| 10 setup_initsvn |
| 11 setup_gitsvn |
| 12 |
| 13 ( |
| 14 set -e |
| 15 cd git-svn |
| 16 |
| 17 # We need a server set up, but we don't use it. |
| 18 git config rietveld.server localhost:1 |
| 19 |
| 20 # Install a pre-cl-upload hook. |
| 21 echo "#!/bin/bash" > .git/hooks/pre-cl-upload |
| 22 echo "echo 'sample preupload fail'" >> .git/hooks/pre-cl-upload |
| 23 echo "exit 1" >> .git/hooks/pre-cl-upload |
| 24 chmod 755 .git/hooks/pre-cl-upload |
| 25 |
| 26 # Install a pre-cl-dcommit hook. |
| 27 echo "#!/bin/bash" > .git/hooks/pre-cl-dcommit |
| 28 echo "echo 'sample predcommit fail'" >> .git/hooks/pre-cl-dcommit |
| 29 echo "exit 1" >> .git/hooks/pre-cl-dcommit |
| 30 chmod 755 .git/hooks/pre-cl-dcommit |
| 31 |
| 32 echo "some work done" >> test |
| 33 git add test; git commit -q -m "work" |
| 34 |
| 35 # Verify git cl upload fails. |
| 36 test_expect_failure "git-cl upload hook fails" "$GIT_CL upload master" |
| 37 |
| 38 # Verify git cl upload fails. |
| 39 test_expect_failure "git-cl dcommit hook fails" "$GIT_CL dcommit master" |
| 40 ) |
| 41 SUCCESS=$? |
| 42 |
| 43 #cleanup |
| 44 |
| 45 if [ $SUCCESS == 0 ]; then |
| 46 echo PASS |
| 47 fi |
OLD | NEW |