upload-local-tracking-branch.sh 793 Bytes
Newer Older
1 2
#!/bin/bash

3 4 5 6
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
set -e

. ./test-lib.sh

setup_initgit
setup_gitgit

(
  set -e
  cd git-git
  git checkout -q -b work HEAD^
  git checkout -q -t -b work2 work
  echo "some work done on a branch that tracks a local branch" >> test
  git add test; git commit -q -m "local tracking branch work"

22
  git config rietveld.server localhost:10000
23 24

  # Prevent the editor from coming up when you upload.
25
  export GIT_EDITOR=$(which true)
26 27 28 29 30 31 32 33 34 35
  test_expect_success "upload succeeds (needs a server running on localhost)" \
    "$GIT_CL upload -m test | grep -q 'Issue created'"
)
SUCCESS=$?

cleanup

if [ $SUCCESS == 0 ]; then
  echo PASS
fi