From 561e82533f536514c089baef18887a507feae28e Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Thu, 28 Sep 2017 19:10:40 +0200 Subject: Add .git suffix in one place --- lib/gitlab/shell.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/gitlab/shell.rb b/lib/gitlab/shell.rb index a31ba14dc45..1736558cc5b 100644 --- a/lib/gitlab/shell.rb +++ b/lib/gitlab/shell.rb @@ -73,16 +73,16 @@ module Gitlab # # Gitaly migration: https://gitlab.com/gitlab-org/gitaly/issues/387 def add_repository(storage, name) + name << '.git' unless name.end_with?('.git') + gitaly_migrate(:create_repository) do |is_enabled| if is_enabled - repository = Gitlab::Git::Repository.new(storage, name + '.git', '') + repository = Gitlab::Git::Repository.new(storage, name) repository.gitaly_repository_client.create_repository true else storage_path = Gitlab.config.repositories.storages[storage]['path'] - repo_path = storage_path + name - repo_path << '.git' unless repo_path.end_with?('.git') - Gitlab::Git::Repository.create(repo_path, bare: true, symlink_hooks_to: gitlab_shell_hooks_path) + Gitlab::Git::Repository.create(storage_path + name, bare: true, symlink_hooks_to: gitlab_shell_hooks_path) end end rescue => err -- cgit v1.2.1