Skip to content

Commit dfb9ac3

Browse files
committed
Merge branch '_acet-fix-diff-file-header' into 'master'
Fix showing diff file header for renamed files Closes #48887 See merge request gitlab-org/gitlab-ce!22089
2 parents 5ed4716 + 8aedb71 commit dfb9ac3

File tree

5 files changed

+11
-102
lines changed

5 files changed

+11
-102
lines changed

app/assets/javascripts/diffs/components/diff_file_header.vue

+4-6
Original file line numberDiff line numberDiff line change
@@ -166,18 +166,16 @@ export default {
166166
:title="diffFile.oldPath"
167167
class="file-title-name"
168168
data-container="body"
169-
>
170-
{{ diffFile.oldPath }}
171-
</strong>
169+
v-html="diffFile.oldPathHtml"
170+
></strong>
172171
173172
<strong
174173
v-tooltip
175174
:title="diffFile.newPath"
176175
class="file-title-name"
177176
data-container="body"
178-
>
179-
{{ diffFile.newPath }}
180-
</strong>
177+
v-html="diffFile.newPathHtml"
178+
></strong>
181179
</span>
182180

183181
<strong

app/assets/javascripts/notes/components/diff_file_header.vue

-94
This file was deleted.

app/serializers/diff_file_entity.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class DiffFileEntity < Grape::Entity
8484
end
8585

8686
expose :old_path_html do |diff_file|
87-
old_path = mark_inline_diffs(diff_file.old_path, diff_file.new_path)
87+
old_path, _ = mark_inline_diffs(diff_file.old_path, diff_file.new_path)
8888
old_path
8989
end
9090

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: Fix showing diff file header for renamed files
3+
merge_request: 22089
4+
author:
5+
type: fixed

spec/javascripts/diffs/mock_data/diff_file.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default {
3333
contentSha: 'c48ee0d1bf3b30453f5b32250ce03134beaa6d13',
3434
storedExternally: null,
3535
externalStorage: null,
36-
oldPathHtml: ['CHANGELOG', 'CHANGELOG'],
36+
oldPathHtml: 'CHANGELOG',
3737
newPathHtml: 'CHANGELOG',
3838
editPath: '/gitlab-org/gitlab-test/edit/spooky-stuff/CHANGELOG',
3939
viewPath: '/gitlab-org/gitlab-test/blob/spooky-stuff/CHANGELOG',

0 commit comments

Comments
 (0)