diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-16 15:07:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-16 15:07:24 +0300 |
commit | d2199d74936cd5cb9f45f569f723a5370ae5013e (patch) | |
tree | f98a19436c9d37e2030c965f561497218dae9d27 /app/models/snippet.rb | |
parent | aeda2f64b45ff2bbcf2150dc75a6cbf1eec5c07f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/snippet.rb')
-rw-r--r-- | app/models/snippet.rb | 14 |
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 |