| OLD | NEW |
| 1 #!/usr/bin/env bash | 1 #!/usr/bin/env bash |
| 2 | 2 |
| 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 set -e | 7 set -e |
| 8 | 8 |
| 9 . ./test-lib.sh | 9 . ./test-lib.sh |
| 10 | 10 |
| 11 setup_initsvn | 11 setup_git_remote |
| 12 setup_gitsvn | 12 setup_git_checkout |
| 13 | 13 |
| 14 ( | 14 ( |
| 15 set -e | 15 set -e |
| 16 cd git-svn | 16 cd git_checkout |
| 17 | 17 |
| 18 cat > .git/hooks/post-cl-dcommit << _EOF | 18 cat > .git/hooks/post-cl-land << _EOF |
| 19 #!/usr/bin/env bash | 19 #!/usr/bin/env bash |
| 20 git branch -m COMMITTED | 20 git branch -m COMMITTED |
| 21 _EOF | 21 _EOF |
| 22 chmod +x .git/hooks/post-cl-dcommit | 22 chmod +x .git/hooks/post-cl-land |
| 23 | 23 |
| 24 git config rietveld.server localhost:1 | 24 git config rietveld.server localhost:1 |
| 25 git checkout -q --track -b work | 25 git checkout -q -t origin/master -b work |
| 26 echo "some work done" >> test | 26 echo "some work done" >> test |
| 27 git add test; git commit -q -m "work \ | 27 git add test; git commit -q -m "work \ |
| 28 TBR=foo" | 28 TBR=foo" |
| 29 | 29 |
| 30 test_expect_success "dcommitted code" \ | 30 test_expect_success "landed code" \ |
| 31 "$GIT_CL dcommit --no-oauth2 -f --bypass-hooks -m 'dcommit'" | 31 "$GIT_CL land --no-oauth2 -f --bypass-hooks -m 'land'" |
| 32 | 32 |
| 33 test_expect_success "post-cl-dcommit hook executed" \ | 33 test_expect_success "post-cl-land hook executed" \ |
| 34 "git symbolic-ref HEAD | grep -q COMMITTED" | 34 "git symbolic-ref HEAD | grep -q COMMITTED" |
| 35 ) | 35 ) |
| 36 SUCCESS=$? | 36 SUCCESS=$? |
| 37 | 37 |
| 38 cleanup | 38 cleanup |
| 39 | 39 |
| 40 if [ $SUCCESS == 0 ]; then | 40 if [ $SUCCESS == 0 ]; then |
| 41 echo PASS | 41 echo PASS |
| 42 fi | 42 fi |
| OLD | NEW |