]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Pass author config to `git` with "-c x=y" instead of "--author"
authorepriestley <git@epriestley.com>
Sun, 4 Oct 2015 15:49:20 +0000 (08:49 -0700)
committerepriestley <git@epriestley.com>
Sun, 4 Oct 2015 15:49:20 +0000 (08:49 -0700)
Summary: See D14232. That didn't actually work. It looks like this does.

Test Plan:
  - Ran `git commit --author ...` on build server and saw the same failure.
  - Ran `git -c ... -c ... commit ...` on build server and saw it work.

Reviewers: chad

Reviewed By: chad

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

src/parser/__tests__/ArcanistBundleTestCase.php

index 8ff7339e5932ee4f41e57b7b9ffc3c8b709fdc65..8fa78f0ae2d5cc91e15242b8b651c007fda2e609 100644 (file)
@@ -137,9 +137,15 @@ final class ArcanistBundleTestCase extends PhutilTestCase {
         throw $ex;
       }
 
-      $author = 'unit-test <unit-test@phabricator.com>';
-
-      execx('git commit --author %s -m %s', $author, $subject);
+      // If these aren't configured, Git complains even if we pass --author.
+      $git_name = 'unit-test';
+      $git_email = 'unit-test@phabricator.com';
+
+      execx(
+        'git -c user.name=%s -c user.email=%s commit -m %s',
+        $git_name,
+        $git_email,
+        $subject);
       list($result_hash) = execx('git log -n1 --format=%s', '%T');
       $result_hash = trim($result_hash);