upstream.sh 727 Bytes
Newer Older
1
#!/usr/bin/env bash
2

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
# Check guessing the svn upstream branch.

set -e

. ./test-lib.sh

setup_initsvn
setup_gitsvn

(
  set -e
  cd git-svn

20
  git config rietveld.server localhost:10000
21

22
  for ref in refs/remotes/origin/trunk refs/remotes/origin/some_branch; do
23 24
    git branch -f --set-upstream feature_branch $ref
    git checkout -q feature_branch
25 26 27 28 29 30 31 32 33 34 35 36 37
    test_expect_success "Guessing upstream branch for $ref" \
        "$GIT_CL upstream | egrep -q '^$ref$'"
    git checkout -q master
  done
)

SUCCESS=$?

cleanup

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