diff options
author | Douwe Maan <douwe@gitlab.com> | 2018-10-30 23:43:27 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-10-30 23:43:27 +0300 |
commit | 7bcd0dc19bfd31e79d52ae148d3edf15b054cb5a (patch) | |
tree | d1f4075d37ac5420233fb68dc5b239b827573791 /lib/gitlab/git/wiki.rb | |
parent | 908a19570fe3bba720eecb7463617184230e429f (diff) | |
parent | 81f5955eb6677849c15d35b60223312f6a9d77a3 (diff) |
Merge branch 'bvl-move-wrapped-gitaly-errors' into 'master'
Move Repository#wrapped_gitaly_errors into concern
See merge request gitlab-org/gitlab-ce!22691
Diffstat (limited to 'lib/gitlab/git/wiki.rb')
-rw-r--r-- | lib/gitlab/git/wiki.rb | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/gitlab/git/wiki.rb b/lib/gitlab/git/wiki.rb index 7fe56979d5c..02c643d0da0 100644 --- a/lib/gitlab/git/wiki.rb +++ b/lib/gitlab/git/wiki.rb @@ -1,6 +1,8 @@ module Gitlab module Git class Wiki + include Gitlab::Git::WrapsGitalyErrors + DuplicatePageError = Class.new(StandardError) OperationError = Class.new(StandardError) @@ -65,37 +67,37 @@ module Gitlab end def write_page(name, format, content, commit_details) - @repository.wrapped_gitaly_errors do + wrapped_gitaly_errors do gitaly_write_page(name, format, content, commit_details) end end def delete_page(page_path, commit_details) - @repository.wrapped_gitaly_errors do + wrapped_gitaly_errors do gitaly_delete_page(page_path, commit_details) end end def update_page(page_path, title, format, content, commit_details) - @repository.wrapped_gitaly_errors do + wrapped_gitaly_errors do gitaly_update_page(page_path, title, format, content, commit_details) end end def pages(limit: 0) - @repository.wrapped_gitaly_errors do + wrapped_gitaly_errors do gitaly_get_all_pages(limit: limit) end end def page(title:, version: nil, dir: nil) - @repository.wrapped_gitaly_errors do + wrapped_gitaly_errors do gitaly_find_page(title: title, version: version, dir: dir) end end def file(name, version) - @repository.wrapped_gitaly_errors do + wrapped_gitaly_errors do gitaly_find_file(name, version) end end @@ -105,7 +107,7 @@ module Gitlab # :per_page - The number of items per page. # :limit - Total number of items to return. def page_versions(page_path, options = {}) - versions = @repository.wrapped_gitaly_errors do + versions = wrapped_gitaly_errors do gitaly_wiki_client.page_versions(page_path, options) end @@ -127,7 +129,7 @@ module Gitlab def page_formatted_data(title:, dir: nil, version: nil) version = version&.id - @repository.wrapped_gitaly_errors do + wrapped_gitaly_errors do gitaly_wiki_client.get_formatted_data(title: title, dir: dir, version: version) end end |