Commit 4731ec44 authored by iannucci@chromium.org's avatar iannucci@chromium.org

Fix upstream.sh presubmit test for git 1.8.3+

Previously this relied on being able to track branches which didn't have a
remote refspec. Now we add a fake origin for the git-svn test repo, and use
--prefix so that git has a remote to track and the refs are correctly
namespaced.

Should also be backwards compatible with older versions of git.

R=maruel@chromium.org
BUG=

Review URL: https://codereview.chromium.org/61893006

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@233649 0039d316-1c4b-4281-b951-d872f2087c98
parent 3665cd2c
......@@ -49,9 +49,10 @@ setup_gitsvn() {
rm -rf git-svn
# There appears to be no way to make git-svn completely shut up, so we
# redirect its output.
git svn -q clone -s $REPO_URL git-svn >/dev/null 2>&1
git svn --prefix origin/ -q clone -s $REPO_URL git-svn >/dev/null 2>&1
(
cd git-svn
git remote add origin https://example.com/fake_refspec
git config user.name 'TestDood'
git config user.email 'TestDood@example.com'
)
......
......@@ -19,7 +19,7 @@ setup_gitsvn
git config rietveld.server localhost:8080
for ref in refs/remotes/trunk refs/remotes/some_branch; do
for ref in refs/remotes/origin/trunk refs/remotes/origin/some_branch; do
git branch -f --set-upstream feature_branch $ref
git checkout -q feature_branch
test_expect_success "Guessing upstream branch for $ref" \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment