Add support for post-dcommit/post-push hooks.
Patch contributed by sadrul@chromium.org Review URL: http://codereview.chromium.org/5972005 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@71097 0039d316-1c4b-4281-b951-d872f2087c98experimental/szager/collated-output
							parent
							
								
									c76e675fb5
								
							
						
					
					
						commit
						0ba7f967e1
					
				@ -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 --tbr --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
 | 
			
		||||
					Loading…
					
					
				
		Reference in New Issue