Fix CreateLocalGitDirectory for tests.

If you didn't setup user.email and user.name `git commit` fails.
This configures user.email and user.name for newly created temporary git
repo.
This commit is contained in:
Tomas Kral 2017-01-19 13:01:56 +01:00
parent f68be75d60
commit f530f99f02
No known key found for this signature in database
GPG Key ID: E690DA7E4F291FA6

View File

@ -26,9 +26,12 @@ func CreateLocalDirectory(t *testing.T) string {
func CreateLocalGitDirectory(t *testing.T) string {
dir := CreateLocalDirectory(t)
cmd := NewCommand(
`git init && touch README &&
git add README &&
git commit -m 'testcommit'`)
`git init &&
git config user.email "you@example.com" &&
git config user.name "Your Name" &&
touch README &&
git add README &&
git commit --no-gpg-sign -m 'testcommit'`)
cmd.Dir = dir
_, err := cmd.Output()
if err != nil {