From 713b8d116814d83f6bfe452091a40269cc9d42ec Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Tue, 19 Sep 2017 16:02:46 +0200 Subject: Expose internal repository create method for gitaly --- lib/gitlab/git/repository.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb index 18210bcab4e..d69fbef0c06 100644 --- a/lib/gitlab/git/repository.rb +++ b/lib/gitlab/git/repository.rb @@ -25,7 +25,11 @@ module Gitlab def create(storage_path, name, bare: true, symlink_hooks_to: nil) repo_path = File.join(storage_path, name) repo_path += '.git' unless repo_path.end_with?('.git') + create_at_path(repo_path, bare, symlink_hooks_to) + end + # Used internally by gitaly-ruby + def create_at_path(repo_path, bare:, symlink_hooks_to:) FileUtils.mkdir_p(repo_path, mode: 0770) # Equivalent to `git --git-path=#{repo_path} init [--bare]` -- cgit v1.2.1