summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorMarkus Koller <mkoller@gitlab.com>2019-06-20 14:59:58 +0200
committerMarkus Koller <mkoller@gitlab.com>2019-06-20 18:05:12 +0200
commit6905a62867067f2f61feb6734be3972cb5b9f7a7 (patch)
treeea953acc268cc1c747870ee88d2892a174b65878 /app
parentf4605ad880e9b76c94218cb7c4f16215c4f62e8e (diff)
downloadgitlab-ce-6905a62867067f2f61feb6734be3972cb5b9f7a7.tar.gz
Build correct basenames for title search resultssearch-blob-basenames
The "basename" here needs to be the full path without the trailing extension, instead of stripping the leading path as well. This was previously fixed in 2f36efa0871 inside the view, but the problematic code was still present in FoundBlob, and the corresponding spec didn't actually use a child wiki page to properly verify the fix.
Diffstat (limited to 'app')
-rw-r--r--app/views/search/results/_wiki_blob.html.haml2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/views/search/results/_wiki_blob.html.haml b/app/views/search/results/_wiki_blob.html.haml
index 5847751b268..b351ecd4edf 100644
--- a/app/views/search/results/_wiki_blob.html.haml
+++ b/app/views/search/results/_wiki_blob.html.haml
@@ -1,5 +1,5 @@
- project = find_project_for_result_blob(projects, wiki_blob)
- wiki_blob = parse_search_result(wiki_blob)
-- wiki_blob_link = project_wiki_path(project, Pathname.new(wiki_blob.filename).sub_ext(''))
+- wiki_blob_link = project_wiki_path(project, wiki_blob.basename)
= render partial: 'search/results/blob_data', locals: { blob: wiki_blob, project: project, file_name: wiki_blob.filename, blob_link: wiki_blob_link }