diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-01 21:12:39 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-01 21:12:39 +0300 |
commit | 68ce709bef9bc89bbb9869e24508777bbe0a1a1d (patch) | |
tree | 65dc0fd3693312debb7f40586c5682162081dc6c /lib/gitlab | |
parent | b21334799a5226cdef52d4fb3b148f08af209f1a (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab')
-rw-r--r-- | lib/gitlab/bitbucket_import/importers/repository_importer.rb | 11 | ||||
-rw-r--r-- | lib/gitlab/ci/config/header/input.rb | 1 |
2 files changed, 11 insertions, 1 deletions
diff --git a/lib/gitlab/bitbucket_import/importers/repository_importer.rb b/lib/gitlab/bitbucket_import/importers/repository_importer.rb index b8c0ba69d37..9be7ed99436 100644 --- a/lib/gitlab/bitbucket_import/importers/repository_importer.rb +++ b/lib/gitlab/bitbucket_import/importers/repository_importer.rb @@ -19,6 +19,7 @@ module Gitlab validate_repository_size! + set_default_branch update_clone_time end @@ -76,6 +77,16 @@ module Gitlab def validate_repository_size! # Defined in EE end + + def set_default_branch + default_branch = client.repo(project.import_source).default_branch + + project.change_head(default_branch) if default_branch + end + + def client + Bitbucket::Client.new(project.import_data.credentials) + end end end end diff --git a/lib/gitlab/ci/config/header/input.rb b/lib/gitlab/ci/config/header/input.rb index 2d124f24c87..08ee70b6290 100644 --- a/lib/gitlab/ci/config/header/input.rb +++ b/lib/gitlab/ci/config/header/input.rb @@ -19,7 +19,6 @@ module Gitlab validations do validates :config, type: Hash, allowed_keys: ALLOWED_KEYS validates :key, alphanumeric: true - validates :input_default, alphanumeric: true, allow_nil: true validates :input_description, alphanumeric: true, allow_nil: true validates :input_regex, type: String, allow_nil: true validates :input_type, allow_nil: true, allowed_values: Interpolation::Inputs.input_types |