diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-05 18:09:28 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-05 18:09:28 +0300 |
commit | 4046c3447e0a01fe48e224e72e12b27859b92822 (patch) | |
tree | 63b8293134d5cc6030abc7a5d2aeb34a34f54925 /app/services/git | |
parent | 64f7eb2b37aebbb713463b2f6971b13191c1b0db (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/git')
-rw-r--r-- | app/services/git/branch_hooks_service.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/app/services/git/branch_hooks_service.rb b/app/services/git/branch_hooks_service.rb index 19b9b439fed..825faf59c13 100644 --- a/app/services/git/branch_hooks_service.rb +++ b/app/services/git/branch_hooks_service.rb @@ -2,6 +2,8 @@ module Git class BranchHooksService < ::Git::BaseHooksService + extend ::Gitlab::Utils::Override + def execute execute_branch_hooks @@ -41,9 +43,14 @@ module Git super end + override :invalidated_file_types def invalidated_file_types return super unless default_branch? && !creating_branch? + modified_file_types + end + + def modified_file_types paths = commit_paths.values.reduce(&:merge) || Set.new Gitlab::FileDetector.types_in_paths(paths) @@ -82,6 +89,7 @@ module Git def enqueue_metrics_dashboard_sync return unless default_branch? + return unless modified_file_types.include?(:metrics_dashboard) ::Metrics::Dashboard::SyncDashboardsWorker.perform_async(project.id) end @@ -210,10 +218,10 @@ module Git def commit_paths strong_memoize(:commit_paths) do - limited_commits.map do |commit| + limited_commits.to_h do |commit| paths = Set.new(commit.raw_deltas.map(&:new_path)) [commit, paths] - end.to_h + end end end end |