Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Unified Diff: git_cl/test/hooks.sh

Issue 5012006: Move git-cl into depot_tools.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: '' Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « git_cl/test/basic.sh ('k') | git_cl/test/push-basic.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_cl/test/hooks.sh
===================================================================
--- git_cl/test/hooks.sh (revision 0)
+++ git_cl/test/hooks.sh (revision 0)
@@ -0,0 +1,47 @@
+#!/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
+
+(
+ set -e
+ cd git-svn
+
+ # We need a server set up, but we don't use it.
+ git config rietveld.server localhost:1
+
+ # Install a pre-cl-upload hook.
+ echo "#!/bin/bash" > .git/hooks/pre-cl-upload
+ echo "echo 'sample preupload fail'" >> .git/hooks/pre-cl-upload
+ echo "exit 1" >> .git/hooks/pre-cl-upload
+ chmod 755 .git/hooks/pre-cl-upload
+
+ # Install a pre-cl-dcommit hook.
+ echo "#!/bin/bash" > .git/hooks/pre-cl-dcommit
+ echo "echo 'sample predcommit fail'" >> .git/hooks/pre-cl-dcommit
+ echo "exit 1" >> .git/hooks/pre-cl-dcommit
+ chmod 755 .git/hooks/pre-cl-dcommit
+
+ echo "some work done" >> 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 upload fails.
+ test_expect_failure "git-cl dcommit hook fails" "$GIT_CL dcommit master"
+)
+SUCCESS=$?
+
+#cleanup
+
+if [ $SUCCESS == 0 ]; then
+ echo PASS
+fi
Property changes on: git_cl/test/hooks.sh
___________________________________________________________________
Added: svn:executable
+ *
« no previous file with comments | « git_cl/test/basic.sh ('k') | git_cl/test/push-basic.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698