forked from LaconicNetwork/kompose
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:
parent
f68be75d60
commit
f530f99f02
@ -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 {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user