From 19bbfa2db23c5135a72a25c835a533d35b9acdf9 Mon Sep 17 00:00:00 2001 From: "ukai@chromium.org" Date: Fri, 3 Feb 2012 16:18:11 +0000 Subject: [PATCH] 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 --- git_cl.py | 2 +- tests/git_cl_test.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/git_cl.py b/git_cl.py index f78839b2d..fc0348506 100755 --- a/git_cl.py +++ b/git_cl.py @@ -913,7 +913,7 @@ def GerritUpload(options, args, cl): git_command = ['push'] if receive_options: - git_command.append('--receive-pack="git receive-pack %s"' % + git_command.append('--receive-pack=git receive-pack %s' % ' '.join(receive_options)) git_command += [remote, 'HEAD:refs/for/' + branch] RunGit(git_command) diff --git a/tests/git_cl_test.py b/tests/git_cl_test.py index 447b352ce..2c6b55386 100755 --- a/tests/git_cl_test.py +++ b/tests/git_cl_test.py @@ -352,12 +352,12 @@ class TestGitCl(TestCase): description), ((['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 if reviewers: receive_pack += ' ' receive_pack += ' '.join(['--reviewer=' + email for email in reviewers]) - receive_pack += '"' + receive_pack += '' calls += [ ((['git', 'push', receive_pack, 'origin', 'HEAD:refs/for/master'],), '')