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

Unified Diff: test/post-dcommit-hook-test.sh

Issue 5972005: Add support for post-dcommit hooks (Closed) Base URL: http://git.chromium.org/git/git-cl.git@master
Patch Set: move code outside of master 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
« git_cl.py ('K') | « git_cl.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/post-dcommit-hook-test.sh
diff --git a/test/post-dcommit-hook-test.sh b/test/post-dcommit-hook-test.sh
new file mode 100755
index 0000000000000000000000000000000000000000..aa3d05d639ab2edd7a161067f0732385c3a11624
--- /dev/null
+++ b/test/post-dcommit-hook-test.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+set -e
+
+. ./test-lib.sh
+
+setup_initsvn
+setup_gitsvn
+
+(
+ set -e
+ cd git-svn
+
+ cat > .git/hooks/post-cl-dcommit << _EOF
+#!/bin/bash
+git branch -m COMMITTED
+_EOF
+ chmod +x .git/hooks/post-cl-dcommit
+
+ git config rietveld.server localhost:1
+ git checkout -q --track -b work
+ echo "some work done" >> test
+ git add test; git commit -q -m "work"
+
+ test_expect_success "dcommitted code" \
+ "$GIT_CL dcommit -f --bypass-hooks -m 'dcommit'"
+
+ test_expect_success "post-cl-dcommit hook executed" \
+ "git symbolic-ref HEAD | grep -q COMMITTED"
+)
+SUCCESS=$?
+
+cleanup
+
+if [ $SUCCESS == 0 ]; then
+ echo PASS
+fi
« git_cl.py ('K') | « git_cl.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698