Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-08-18 21:19:18 +0300
committerDouwe Maan <douwe@gitlab.com>2016-08-18 21:19:18 +0300
commitba0c6e4dd8178d69f3e2878205f24b62120acc55 (patch)
treeb54640a3673cfb9b12a79e91f9f6dcd9a15d0d2f /app/views/projects
parent4ddd7222e5fa5da997322b98855509191099de8b (diff)
parent938f3b2a0b4bdf2047caf8735312c80e2291b274 (diff)
Merge branch '20454-edit-button-mr' into 'master'
edit_blob_link can receive the blob to avoid access to the repository ## What does this MR do? Avoid access to the repository to get the blob when can be passed on context ## Are there points in the code the reviewer needs to double check? ## Why was this MR needed? #20454 to try to speed up the diff pages ## What are the relevant issue numbers? Relates #20454 probably we want and UI solution not just a backend solution ## Screenshots (if relevant) ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - ~~[ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~ - ~~[ ] API support added~~ - Tests - [x] Added for this feature/bug - [ ] All builds are passing - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if you do - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) See merge request !5850
Diffstat (limited to 'app/views/projects')
-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)