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-07-19 03:09:42 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-07-19 03:09:42 +0300
commit91d37b971433b16c25ec501429ac643f9c49839e (patch)
tree59ced702b47ff50a967653e2207f5a602513dca1 /lib/gitlab/changelog
parent540020f8155ff0686ae9a51a16414661e3cdaf9d (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/changelog')
-rw-r--r--lib/gitlab/changelog/config.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/gitlab/changelog/config.rb b/lib/gitlab/changelog/config.rb
index 9cb3d71f5c3..8fcc03ec437 100644
--- a/lib/gitlab/changelog/config.rb
+++ b/lib/gitlab/changelog/config.rb
@@ -7,9 +7,9 @@ module Gitlab
# When rendering changelog entries, authors are not included.
AUTHORS_NONE = 'none'
- # The path to the configuration file as stored in the project's Git
+ # The default path to the configuration file as stored in the project's Git
# repository.
- FILE_PATH = '.gitlab/changelog_config.yml'
+ DEFAULT_FILE_PATH = '.gitlab/changelog_config.yml'
# The default date format to use for formatting release dates.
DEFAULT_DATE_FORMAT = '%Y-%m-%d'
@@ -36,8 +36,9 @@ module Gitlab
attr_accessor :date_format, :categories, :template, :tag_regex, :always_credit_user_ids
- def self.from_git(project, user = nil)
- if (yaml = project.repository.changelog_config.presence)
+ def self.from_git(project, user = nil, path = nil)
+ yaml = project.repository.changelog_config('HEAD', path.presence || DEFAULT_FILE_PATH)
+ if yaml.present?
from_hash(project, YAML.safe_load(yaml), user)
else
new(project)