Commit e569f503 authored by agable@chromium.org's avatar agable@chromium.org

Assume 'master' when remote branch not specified.

This prevents apply_patch from attempting to check out a branch tracking 'origin/None'.

R=pgervais@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@257763 0039d316-1c4b-4281-b951-d872f2087c98
parent a4e4ef38
...@@ -161,8 +161,13 @@ def main(): ...@@ -161,8 +161,13 @@ def main():
if scm_type == 'svn': if scm_type == 'svn':
scm_obj = checkout.SvnCheckout(full_dir, None, None, None, None) scm_obj = checkout.SvnCheckout(full_dir, None, None, None, None)
elif scm_type == 'git': elif scm_type == 'git':
scm_obj = checkout.GitCheckout(full_dir, None, None, None, None, scm_obj = checkout.GitCheckout(root_dir=full_dir,
base_ref=options.base_ref,) project_name=None,
remote_branch='master',
git_url=None,
commit_user=None,
base_ref=options.base_ref,
post_processors=None)
elif scm_type == None: elif scm_type == None:
scm_obj = checkout.RawCheckout(full_dir, None, None) scm_obj = checkout.RawCheckout(full_dir, None, None)
else: else:
......
...@@ -562,6 +562,7 @@ class GitCheckout(CheckoutBase): ...@@ -562,6 +562,7 @@ class GitCheckout(CheckoutBase):
self.git_url = git_url self.git_url = git_url
self.commit_user = commit_user self.commit_user = commit_user
self.remote_branch = remote_branch self.remote_branch = remote_branch
assert self.remote_branch
# The working branch where patches will be applied. It will track the # The working branch where patches will be applied. It will track the
# remote branch. # remote branch.
self.working_branch = 'working_branch' self.working_branch = 'working_branch'
...@@ -624,7 +625,9 @@ class GitCheckout(CheckoutBase): ...@@ -624,7 +625,9 @@ class GitCheckout(CheckoutBase):
# trying again? # trying again?
if self.remote_branch: if self.remote_branch:
self._check_call_git( self._check_call_git(
['checkout', '-b', self.working_branch, '-t', self.remote_branch, ['checkout',
'-b', self.working_branch,
'-t', '%s/%s' % (self.pull_remote, self.remote_branch),
'--quiet']) '--quiet'])
for index, p in enumerate(patches): for index, p in enumerate(patches):
......
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