diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-05 18:14:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-05 18:14:35 +0300 |
commit | 6634288474d2a83cac7b4205f3ffc736cc6b36db (patch) | |
tree | 40f13dbe9e39ee30d5ec19a32fa792938b64a8e7 /app | |
parent | eb3f624622331c74198ba299af90bd1e431a330f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/ci/artifacts/components/artifacts_table_row_details.vue | 2 | ||||
-rw-r--r-- | app/models/concerns/counter_attribute.rb | 2 | ||||
-rw-r--r-- | app/models/project.rb | 4 | ||||
-rw-r--r-- | app/services/projects/create_service.rb | 18 | ||||
-rw-r--r-- | app/views/projects/readme_templates/default.md.tt | 4 |
5 files changed, 19 insertions, 11 deletions
diff --git a/app/assets/javascripts/ci/artifacts/components/artifacts_table_row_details.vue b/app/assets/javascripts/ci/artifacts/components/artifacts_table_row_details.vue index ea0d4d585be..e893040edd8 100644 --- a/app/assets/javascripts/ci/artifacts/components/artifacts_table_row_details.vue +++ b/app/assets/javascripts/ci/artifacts/components/artifacts_table_row_details.vue @@ -103,7 +103,7 @@ export default { }; </script> <template> - <div :style="scrollContainerStyle"> + <div :style="scrollContainerStyle" class="gl-overflow-auto"> <dynamic-scroller :items="artifacts.nodes" :min-item-size="$options.ARTIFACT_ROW_HEIGHT"> <template #default="{ item, index, active }"> <dynamic-scroller-item :item="item" :active="active" :class="{ active }"> diff --git a/app/models/concerns/counter_attribute.rb b/app/models/concerns/counter_attribute.rb index d7ee533b53c..56608c49a6b 100644 --- a/app/models/concerns/counter_attribute.rb +++ b/app/models/concerns/counter_attribute.rb @@ -201,8 +201,6 @@ module CounterAttribute # # It does not guarantee that there will not be any concurrent updates. def detect_race_on_record(log_fields: {}) - return yield unless Feature.enabled?(:counter_attribute_db_lease_for_update, project) - # Ensure attributes is always an array before we log log_fields[:attributes] = Array(log_fields[:attributes]) diff --git a/app/models/project.rb b/app/models/project.rb index fcbef23bc4c..8f9b7042a0e 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -1876,11 +1876,11 @@ class Project < ApplicationRecord repository.update!(shard_name: repository_storage, disk_path: disk_path) end - def create_repository(force: false) + def create_repository(force: false, default_branch: nil) # Forked import is handled asynchronously return if forked? && !force - repository.create_repository + repository.create_repository(default_branch) repository.after_create true diff --git a/app/services/projects/create_service.rb b/app/services/projects/create_service.rb index 691e2235605..ac19f21ffc7 100644 --- a/app/services/projects/create_service.rb +++ b/app/services/projects/create_service.rb @@ -197,7 +197,7 @@ module Projects def create_readme commit_attrs = { - branch_name: @default_branch.presence || @project.default_branch_or_main, + branch_name: default_branch, commit_message: 'Initial commit', file_path: 'README.md', file_content: readme_content @@ -211,7 +211,11 @@ module Projects end def readme_content - @readme_template.presence || ReadmeRendererService.new(@project, current_user).execute + readme_attrs = { + default_branch: default_branch + } + + @readme_template.presence || ReadmeRendererService.new(@project, current_user, readme_attrs).execute end def skip_wiki? @@ -227,8 +231,10 @@ module Projects @project.create_labels unless @project.gitlab_project_import? - unless @project.import? - raise 'Failed to create repository' unless @project.create_repository + break if @project.import? + + unless @project.create_repository(default_branch: default_branch) + raise 'Failed to create repository' end end end @@ -277,6 +283,10 @@ module Projects private + def default_branch + @default_branch.presence || @project.default_branch_or_main + end + def validate_import_source_enabled! return unless @params[:import_type] diff --git a/app/views/projects/readme_templates/default.md.tt b/app/views/projects/readme_templates/default.md.tt index cd0b2db1d31..ad1d6cce08d 100644 --- a/app/views/projects/readme_templates/default.md.tt +++ b/app/views/projects/readme_templates/default.md.tt @@ -17,8 +17,8 @@ Already a pro? Just edit this README.md and make it your own. Want to make it ea ``` cd existing_repo git remote add origin <%= project.http_url_to_repo %> -git branch -M <%= project.default_branch_or_main %> -git push -uf origin <%= project.default_branch_or_main %> +git branch -M <%= params[:default_branch] %> +git push -uf origin <%= params[:default_branch] %> ``` ## Integrate with your tools |