6f6f9d3
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
6f6f9d3
Date: Tue, 15 Sep 2015 16:35:03 +0200
6f6f9d3
Subject: [PATCH] Use fake home directory to define git user
6f6f9d3
MIME-Version: 1.0
6f6f9d3
Content-Type: text/plain; charset=UTF-8
6f6f9d3
Content-Transfer-Encoding: 8bit
6f6f9d3
6f6f9d3
Without configured git, t/git.t test fails because git tool bails out:
6f6f9d3
6f6f9d3
*** Please tell me who you are.
6f6f9d3
Run
6f6f9d3
  git config --global user.email "you@example.com"
6f6f9d3
  git config --global user.name "Your Name"
6f6f9d3
to set your account's default identity.
6f6f9d3
Omit --global to set the identity only in this repository.
6f6f9d3
6f6f9d3
Signed-off-by: Petr Písař <ppisar@redhat.com>
2ddedd1
6f6f9d3
---
6f6f9d3
 t/git.t | 8 ++++++++
6f6f9d3
 1 file changed, 8 insertions(+)
6f6f9d3
6f6f9d3
diff --git a/t/git.t b/t/git.t
2ddedd1
index 71195fd..4e11ac6 100755
6f6f9d3
--- a/t/git.t
6f6f9d3
+++ b/t/git.t
6f6f9d3
@@ -15,6 +15,14 @@ BEGIN {
6f6f9d3
 	if (! mkdir($dir)) {
6f6f9d3
 		die $@;
6f6f9d3
 	}
6f6f9d3
+	$ENV{HOME} = $dir;
6f6f9d3
+	if (
6f6f9d3
+	    system("$git config --global user.email 'you\@example.com'")
6f6f9d3
+	    || system("$git config --global user.name 'Your Name'")
6f6f9d3
+	) {
6f6f9d3
+	    system("cat $dir/.gitconfig");
6f6f9d3
+	    die "Could not configure git user";
6f6f9d3
+	}
6f6f9d3
 }
2ddedd1
 use Test::More tests => 26;
6f6f9d3
 
6f6f9d3
-- 
2ddedd1
tg: (53b10a6..) t/fakehome (depends on: master)