diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-20 23:50:22 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-20 23:50:22 +0000 |
commit | 9dc93a4519d9d5d7be48ff274127136236a3adb3 (patch) | |
tree | 70467ae3692a0e35e5ea56bcb803eb512a10bedb /app/helpers/blob_helper.rb | |
parent | 4b0f34b6d759d6299322b3a54453e930c6121ff0 (diff) | |
download | gitlab-ce-9dc93a4519d9d5d7be48ff274127136236a3adb3.tar.gz |
Add latest changes from gitlab-org/gitlab@13-11-stable-eev13.11.0-rc43
Diffstat (limited to 'app/helpers/blob_helper.rb')
-rw-r--r-- | app/helpers/blob_helper.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/app/helpers/blob_helper.rb b/app/helpers/blob_helper.rb index 41bbd0fddd5..3144686bba9 100644 --- a/app/helpers/blob_helper.rb +++ b/app/helpers/blob_helper.rb @@ -41,20 +41,20 @@ module BlobHelper result end - def ide_fork_and_edit_path(project = @project, ref = @ref, path = @path, options = {}) - fork_path_for_current_user(project, ide_edit_path(project, ref, path)) + def ide_fork_and_edit_path(project = @project, ref = @ref, path = @path, with_notice: true) + fork_path_for_current_user(project, ide_edit_path(project, ref, path), with_notice: with_notice) end def fork_and_edit_path(project = @project, ref = @ref, path = @path, options = {}) fork_path_for_current_user(project, edit_blob_path(project, ref, path, options)) end - def fork_path_for_current_user(project, path) + def fork_path_for_current_user(project, path, with_notice: true) return unless current_user project_forks_path(project, namespace_key: current_user.namespace&.id, - continue: edit_blob_fork_params(path)) + continue: edit_blob_fork_params(path, with_notice: with_notice)) end def encode_ide_path(path) @@ -330,12 +330,12 @@ module BlobHelper blob if blob&.readable_text? end - def edit_blob_fork_params(path) + def edit_blob_fork_params(path, with_notice: true) { to: path, - notice: edit_in_new_fork_notice, - notice_now: edit_in_new_fork_notice_now - } + notice: (edit_in_new_fork_notice if with_notice), + notice_now: (edit_in_new_fork_notice_now if with_notice) + }.compact end def edit_modify_file_fork_params(action) |