diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2019-04-05 03:19:37 +0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2019-04-05 03:19:37 +0300 |
commit | b54228ad3d79dc0bd7060128e0b75f68cd1c51d9 (patch) | |
tree | 1883aaa4e35d0563fa5fe88145fa0f7d976b0b4f /lib | |
parent | 3ccb4d954f4c51f4f3cc77ebd53f21425e0d4d09 (diff) | |
parent | 6b7a9b7498a4c91ca9c7324a0e31d8a142fddeef (diff) |
Merge branch '9217-warn-on-git-fetch-over-ssh-if-the-secondary-is-lagging-the-primary' into 'master'
Display console messages, if available
See merge request gitlab-org/gitlab-ce!26692
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/internal.rb | 3 | ||||
-rw-r--r-- | lib/gitlab/git_access.rb | 6 | ||||
-rw-r--r-- | lib/gitlab/git_access_result/success.rb | 5 |
3 files changed, 12 insertions, 2 deletions
diff --git a/lib/api/internal.rb b/lib/api/internal.rb index cb9aa849eeb..9c7b9146c8f 100644 --- a/lib/api/internal.rb +++ b/lib/api/internal.rb @@ -87,7 +87,8 @@ module API gl_id: Gitlab::GlId.gl_id(user), gl_username: user&.username, git_config_options: [], - gitaly: gitaly_payload(params[:action]) + gitaly: gitaly_payload(params[:action]), + gl_console_messages: check_result.console_messages } # Custom option for git-receive-pack command diff --git a/lib/gitlab/git_access.rb b/lib/gitlab/git_access.rb index 010bd0e520c..cb80ed64eff 100644 --- a/lib/gitlab/git_access.rb +++ b/lib/gitlab/git_access.rb @@ -85,7 +85,7 @@ module Gitlab check_push_access! end - ::Gitlab::GitAccessResult::Success.new + ::Gitlab::GitAccessResult::Success.new(console_messages: check_for_console_messages(cmd)) end def guest_can_download_code? @@ -116,6 +116,10 @@ module Gitlab nil end + def check_for_console_messages(cmd) + [] + end + def check_valid_actor! return unless actor.is_a?(Key) diff --git a/lib/gitlab/git_access_result/success.rb b/lib/gitlab/git_access_result/success.rb index 7bb9f24cb0e..e950d727e2e 100644 --- a/lib/gitlab/git_access_result/success.rb +++ b/lib/gitlab/git_access_result/success.rb @@ -3,6 +3,11 @@ module Gitlab module GitAccessResult class Success + attr_reader :console_messages + + def initialize(console_messages: []) + @console_messages = console_messages + end end end end |