]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Parameterize `@{upstream}` in arc to fix Windows
authorepriestley <git@epriestley.com>
Thu, 10 Jul 2014 14:56:35 +0000 (07:56 -0700)
committerepriestley <git@epriestley.com>
Thu, 10 Jul 2014 14:56:35 +0000 (07:56 -0700)
Summary: We manually quote this in a couple of places. That works fine on Lunix, but does not work on Windows. Instead, explicitly parameterize the command so the correct quoting rules are applied for the OS.

Test Plan: See IRC; windows user had issues fixed by this. `arc:upstream` still works locally.

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D9868

src/repository/api/ArcanistGitAPI.php

index 5f4d180b47a8fc818f6612eed18b829749db3b13..e9f05f588d31817b68aa4d1787d2e72d49ea690d 100644 (file)
@@ -279,7 +279,8 @@ final class ArcanistGitAPI extends ArcanistRepositoryAPI {
 
     if (!$default_relative) {
       list($err, $upstream) = $this->execManualLocal(
-        "rev-parse --abbrev-ref --symbolic-full-name '@{upstream}'");
+        'rev-parse --abbrev-ref --symbolic-full-name %s',
+        '@{upstream}');
 
       if (!$err) {
         $default_relative = trim($upstream);
@@ -1164,7 +1165,8 @@ final class ArcanistGitAPI extends ArcanistRepositoryAPI {
             break;
           case 'upstream':
             list($err, $upstream) = $this->execManualLocal(
-              "rev-parse --abbrev-ref --symbolic-full-name '@{upstream}'");
+              'rev-parse --abbrev-ref --symbolic-full-name %s',
+              '@{upstream}');
             if (!$err) {
               $upstream = rtrim($upstream);
               list($upstream_merge_base) = $this->execxLocal(