Commit 19bbfa2d authored by ukai@chromium.org's avatar ukai@chromium.org

Fix receive-pack

If we quote as --receive-pack="git receive-pack --reviewer=foo@example.com",
git will try to run "git receive-pack --reviewer=foo@example.com" command
and failed like this

Gerrit Code Review: git receive-pack --reviewer=foo@example.com: not found
fatal: The remote end hung up unexpectedly
Command "git push --receive-pack="git receive-pack --reviewer=foo@example.com" origin HEAD:refs/for/master" failed.

Review URL: http://codereview.chromium.org/9325018

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@120337 0039d316-1c4b-4281-b951-d872f2087c98
parent fe026a43
...@@ -913,7 +913,7 @@ def GerritUpload(options, args, cl): ...@@ -913,7 +913,7 @@ def GerritUpload(options, args, cl):
git_command = ['push'] git_command = ['push']
if receive_options: if receive_options:
git_command.append('--receive-pack="git receive-pack %s"' % git_command.append('--receive-pack=git receive-pack %s' %
' '.join(receive_options)) ' '.join(receive_options))
git_command += [remote, 'HEAD:refs/for/' + branch] git_command += [remote, 'HEAD:refs/for/' + branch]
RunGit(git_command) RunGit(git_command)
......
...@@ -352,12 +352,12 @@ class TestGitCl(TestCase): ...@@ -352,12 +352,12 @@ class TestGitCl(TestCase):
description), description),
((['git', 'config', 'rietveld.cc'],), '') ((['git', 'config', 'rietveld.cc'],), '')
] ]
receive_pack = '--receive-pack="git receive-pack ' receive_pack = '--receive-pack=git receive-pack '
receive_pack += '--cc=joe@example.com' # from watch list receive_pack += '--cc=joe@example.com' # from watch list
if reviewers: if reviewers:
receive_pack += ' ' receive_pack += ' '
receive_pack += ' '.join(['--reviewer=' + email for email in reviewers]) receive_pack += ' '.join(['--reviewer=' + email for email in reviewers])
receive_pack += '"' receive_pack += ''
calls += [ calls += [
((['git', 'push', receive_pack, 'origin', 'HEAD:refs/for/master'],), ((['git', 'push', receive_pack, 'origin', 'HEAD:refs/for/master'],),
'') '')
......
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