summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHerminio Torres <herminiocesar@gmail.com>2016-08-04 01:04:01 -0300
committerHerminio Torres <herminiocesar@gmail.com>2016-08-04 01:22:54 -0300
commitbb193801f892490d64cfe34563a77a7ae90ff5d8 (patch)
treeead69173cd499ebe6b6d2666387666689e8017d9
parent532202a5278a622de874b9dfc1c4f7fe9ddf5ce4 (diff)
downloadgitlab-ce-bb193801f892490d64cfe34563a77a7ae90ff5d8.tar.gz
Fix Mystery Guest
Magic Variable - Change the name of the variable to assign the local variable for partial, rather than `i` use the `index`. Don't pass a local variable called `i` to a partial.
-rw-r--r--CHANGELOG1
-rw-r--r--app/views/projects/diffs/_diffs.html.haml2
-rw-r--r--app/views/projects/diffs/_file.html.haml4
3 files changed, 4 insertions, 3 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 73812e16d6f..8362131a090 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
Please view this file on the master branch, on stable branches it's out of date.
v 8.11.0 (unreleased)
+ - Fix don't pass a local variable called `i` to a partial. !20510 (herminiotorres)
- Fix the title of the toggle dropdown button. !5515 (herminiotorres)
- Improve diff performance by eliminating redundant checks for text blobs
- Convert switch icon into icon font (ClemMakesApps)
diff --git a/app/views/projects/diffs/_diffs.html.haml b/app/views/projects/diffs/_diffs.html.haml
index 20dc280c3b2..ebaf939f930 100644
--- a/app/views/projects/diffs/_diffs.html.haml
+++ b/app/views/projects/diffs/_diffs.html.haml
@@ -29,5 +29,5 @@
- next unless blob
- blob.load_all_data!(diffs.project.repository) unless blob.only_display_raw?
- = render 'projects/diffs/file', i: index, project: diffs.project,
+ = render 'projects/diffs/file', index: index, project: diffs.project,
diff_file: diff_file, diff_commit: diff_commit, blob: blob
diff --git a/app/views/projects/diffs/_file.html.haml b/app/views/projects/diffs/_file.html.haml
index f914e13a1ec..f0a86fd6d40 100644
--- a/app/views/projects/diffs/_file.html.haml
+++ b/app/views/projects/diffs/_file.html.haml
@@ -1,6 +1,6 @@
-.diff-file.file-holder{id: "diff-#{i}", data: diff_file_html_data(project, diff_file)}
+.diff-file.file-holder{id: "diff-#{index}", data: diff_file_html_data(project, diff_file)}
.file-title{id: "file-path-#{hexdigest(diff_file.file_path)}"}
- = render "projects/diffs/file_header", diff_file: diff_file, blob: blob, diff_commit: diff_commit, project: project, url: "#diff-#{i}"
+ = render "projects/diffs/file_header", diff_file: diff_file, blob: blob, diff_commit: diff_commit, project: project, url: "#diff-#{index}"
- unless diff_file.submodule?
.file-actions.hidden-xs