Set author and committer explicitly

With the isolated home area for the unit tests, either missing
GIT_COMMITTER_NAME and GIT_AUTHOR_NAME environment variables or failure
to set the user.name on the local repository config will cause tests to
fail with git complaining about needing to know who is performing the
commit.

Results in seeing the following error message:

  Stdout: *** Please tell me who you are.

  Run

    git config --global user.email "you@example.com"
    git config --global user.name "Your Name"

Change-Id: I4b87b6df3f19260c180af9beed77daf53dc6a7cc
This commit is contained in:
Darragh Bailey 2015-09-11 14:21:38 +01:00
parent 33081ce1d6
commit d64f004bdb
1 changed files with 2 additions and 0 deletions

View File

@ -209,6 +209,8 @@ class BaseGitReviewTestCase(testtools.TestCase, GerritHelpers):
os.environ['XDG_CONFIG_HOME'] = self.xdg_config_dir
os.environ['GIT_CONFIG_NOSYSTEM'] = "1"
os.environ['EMAIL'] = "you@example.com"
os.environ['GIT_AUTHOR_NAME'] = "gitreview tester"
os.environ['GIT_COMMITTER_NAME'] = "gitreview tester"
if not os.path.exists(self.home_dir):
os.mkdir(self.home_dir)
if not os.path.exists(self.xdg_config_dir):