From 2a070f3027a8b3983806c10f85234a9324c71d4b Mon Sep 17 00:00:00 2001 From: "iannucci@chromium.org" Date: Thu, 27 Jun 2013 19:21:10 +0000 Subject: [PATCH] Fix git tests to work regardless of global gitconfig. Previously if one or both of these values were unset, the tests would simply fail because `git config` returns 1. R=dpranke@chromium.org BUG= Review URL: https://chromiumcodereview.appspot.com/18053009 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@208966 0039d316-1c4b-4281-b951-d872f2087c98 --- tests/test-lib.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/test-lib.sh b/tests/test-lib.sh index fc3874e15..4ce05cf82 100755 --- a/tests/test-lib.sh +++ b/tests/test-lib.sh @@ -48,6 +48,11 @@ setup_gitsvn() { # There appears to be no way to make git-svn completely shut up, so we # redirect its output. git svn -q clone -s $REPO_URL git-svn >/dev/null 2>&1 + ( + cd git-svn + git config user.name 'TestDood' + git config user.email 'TestDood@example.com' + ) } # Set up a git-svn checkout of the repo and apply merge commits @@ -60,6 +65,8 @@ setup_gitsvn_submodule() { sed s/^.*:// | xargs` ( cd git-svn-submodule + git config user.name 'TestDood' + git config user.email 'TestDood@example.com' echo 'merge-file line 1' > merge-file git add merge-file; git commit -q -m 'First non-svn commit on master' git checkout -q refs/remotes/trunk @@ -81,6 +88,8 @@ setup_initgit() { ( cd gitrepo git init -q + git config user.name 'TestDood' + git config user.email 'TestDood@example.com' echo "test" > test git add test git commit -qam "initial commit" @@ -97,6 +106,11 @@ setup_gitgit() { echo "Setting up test git repo..." rm -rf git-git git clone -q $GITREPO_URL git-git + ( + cd git-git + git config user.name 'TestDood' + git config user.email 'TestDood@example.com' + ) } cleanup() {