From: epriestley Date: Sun, 4 Oct 2015 15:49:20 +0000 (-0700) Subject: Pass author config to `git` with "-c x=y" instead of "--author" X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=172c930630a960ea79ada1dbeb50f2ad561d3870;p=arcanist.git Pass author config to `git` with "-c x=y" instead of "--author" 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 --- diff --git a/src/parser/__tests__/ArcanistBundleTestCase.php b/src/parser/__tests__/ArcanistBundleTestCase.php index 8ff7339e..8fa78f0a 100644 --- a/src/parser/__tests__/ArcanistBundleTestCase.php +++ b/src/parser/__tests__/ArcanistBundleTestCase.php @@ -137,9 +137,15 @@ final class ArcanistBundleTestCase extends PhutilTestCase { throw $ex; } - $author = 'unit-test '; - - 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);