patch.sh 983 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/usr/bin/env bash
  2. # Copyright (c) 2012 The Chromium Authors. All rights reserved.
  3. # Use of this source code is governed by a BSD-style license that can be
  4. # found in the LICENSE file.
  5. set -e
  6. . ./test-lib.sh
  7. setup_initsvn
  8. setup_gitsvn
  9. (
  10. set -e
  11. cd git-svn
  12. git checkout -q -b work
  13. echo "some work done on a branch" >> test
  14. git add test; git commit -q -m "branch work"
  15. git config rietveld.server localhost:10000
  16. # Prevent the editor from coming up when you upload.
  17. export GIT_EDITOR=$(which true)
  18. test_expect_success "upload succeeds (needs a server running on localhost)" \
  19. "$GIT_CL upload -m test master | grep -q 'Issue created'"
  20. test_expect_success "git-cl status now knows the issue" \
  21. "$GIT_CL_STATUS | grep -q 'Issue number'"
  22. ISSUE=$($GIT_CL_STATUS | awk '$0 ~ "Issue number:" { print $3 }')
  23. git checkout -q -b test2 master
  24. test_expect_success "$GIT_CL patch $ISSUE"
  25. )
  26. SUCCESS=$?
  27. cleanup
  28. if [ $SUCCESS == 0 ]; then
  29. echo PASS
  30. fi