Skip to content

Commit c45d5b1

Browse files
author
Shane da Silva
committed
Always set git user name/email in repo helper
We were having tests fail in some CI contexts due to a lack of configured user name/email for git. Solve this by ensuring all repositories using the `repo` helper in specs have a local user name and email defined. Change-Id: I69ead11de15e83967a4b85a0091b5845ca8392cd Reviewed-on: http://gerrit.causes.com/38044 Tested-by: jenkins <jenkins@causes.com> Reviewed-by: Shane da Silva <shane@causes.com>
1 parent 8683da4 commit c45d5b1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

spec/support/git_spec_helpers.rb

+6
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@ module GitSpecHelpers
77
def repo(name = 'some-repo', &block)
88
directory(name) do
99
`git init --template=""` # Ensure no template directory is applied
10+
1011
`mkdir -p .git/hooks` # Since we don't specify template, need to create ourselves
12+
13+
# Need to define user info since some CI contexts don't have defaults set
14+
`git config --local user.name "Overcommit Tester"`
15+
`git config --local user.email "overcommit@example.com"`
16+
1117
block.call if block_given?
1218
end
1319
end

0 commit comments

Comments
 (0)