summaryrefslogtreecommitdiff
path: root/app/views/projects/diffs/_file.html.haml
diff options
context:
space:
mode:
authorPaco Guzman <pacoguzmanp@gmail.com>2016-08-17 17:05:00 +0200
committerPaco Guzman <pacoguzmanp@gmail.com>2016-08-18 16:30:25 +0200
commit938f3b2a0b4bdf2047caf8735312c80e2291b274 (patch)
tree583dcadb643a9e9a0dd4864f7779166d9af9ccc2 /app/views/projects/diffs/_file.html.haml
parentac73de508e21af95b473bfafc2ca2543b234430d (diff)
downloadgitlab-ce-938f3b2a0b4bdf2047caf8735312c80e2291b274.tar.gz
edit_blob_link can receive the blob to avoid access to the repository20454-edit-button-mr
Diffstat (limited to 'app/views/projects/diffs/_file.html.haml')
-rw-r--r--app/views/projects/diffs/_file.html.haml7
1 files changed, 3 insertions, 4 deletions
diff --git a/app/views/projects/diffs/_file.html.haml b/app/views/projects/diffs/_file.html.haml
index 8fbd89100ca..ad2eb3e504f 100644
--- a/app/views/projects/diffs/_file.html.haml
+++ b/app/views/projects/diffs/_file.html.haml
@@ -10,10 +10,9 @@
\
- if editable_diff?(diff_file)
- = edit_blob_link(@merge_request.source_project,
- @merge_request.source_branch, diff_file.new_path,
- from_merge_request_id: @merge_request.id,
- skip_visible_check: true)
+ - link_opts = @merge_request.id ? { from_merge_request_id: @merge_request.id } : {}
+ = edit_blob_link(@merge_request.source_project, @merge_request.source_branch, diff_file.new_path,
+ blob: blob, link_opts: link_opts)
= view_file_btn(diff_commit.id, diff_file.new_path, project)