diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-11-18 14:04:56 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-11-30 15:24:45 +0300 |
commit | e7cd194b025570a8cb933c89e3895cf07f932561 (patch) | |
tree | f1ae3e1be08fbda8701f88f809b30255ff02b85d | |
parent | ace611c5be35395a5ab1db0a46d2742b76ee4ad3 (diff) |
ruby: Silence spec warnings when there is no template dir
Our rspecs raise a bunch of warnings when creating repositories about
missing template directories if the template directory is indeed missing
from the host it's running on. We do not care about templates though and
have moved away from them already, where Go already knows to not use
them at all anymore. The upcoming change to bundle Git with Gitaly will
make it the norm that there are no templates anymore, and thus we'd
always start to hit this warning.
Fix the issue by explicitly telling Git that it shouldn't use the
template dir when initializing test repos.
-rw-r--r-- | ruby/spec/test_repo_helper.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ruby/spec/test_repo_helper.rb b/ruby/spec/test_repo_helper.rb index 811108637..603de4d08 100644 --- a/ruby/spec/test_repo_helper.rb +++ b/ruby/spec/test_repo_helper.rb @@ -97,13 +97,13 @@ module TestRepo end def self.clone_new_repo!(origin, destination) - return if system(Gitlab.config.git.bin_path, "clone", "--quiet", "--bare", origin.to_s, destination.to_s) + return if system(Gitlab.config.git.bin_path, "-c", "init.templateDir=", "clone", "--quiet", "--bare", origin.to_s, destination.to_s) abort "Failed to clone test repo. Try running 'make prepare-tests' and try again." end def self.init_new_repo!(destination) - return if system(Gitlab.config.git.bin_path, "init", "--quiet", "--bare", destination.to_s) + return if system(Gitlab.config.git.bin_path, "-c", "init.templateDir=", "init", "--quiet", "--bare", destination.to_s) abort "Failed to init test repo." end |