Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-03-16 15:07:24 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-03-16 15:07:24 +0300
commitd2199d74936cd5cb9f45f569f723a5370ae5013e (patch)
treef98a19436c9d37e2030c965f561497218dae9d27 /app/models/snippet.rb
parentaeda2f64b45ff2bbcf2150dc75a6cbf1eec5c07f (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/snippet.rb')
-rw-r--r--app/models/snippet.rb14
1 files changed, 0 insertions, 14 deletions
diff --git a/app/models/snippet.rb b/app/models/snippet.rb
index ac87da4f3c8..38aaeff5c9a 100644
--- a/app/models/snippet.rb
+++ b/app/models/snippet.rb
@@ -350,20 +350,6 @@ class Snippet < ApplicationRecord
snippet_repository&.shard_name || Repository.pick_storage_shard
end
- # Repositories are created with a default branch. This branch
- # can be different from the default branch set in the platform.
- # This method changes the `HEAD` file to point to the existing
- # default branch in case it's different.
- def change_head_to_default_branch
- return unless repository.exists?
- # All snippets must have at least 1 file. Therefore, if
- # `HEAD` is empty is because it's pointing to the wrong
- # default branch
- return unless repository.empty? || list_files('HEAD').empty?
-
- repository.raw_repository.write_ref('HEAD', "refs/heads/#{default_branch}")
- end
-
def create_repository
return if repository_exists? && snippet_repository