Commit e47e537b authored by Fatih Acet's avatar Fatih Acet

Handle renamed files in file header.

parent 29bed996
...@@ -52,6 +52,7 @@ window.MergeConflictDataProvider = class MergeConflictDataProvider { ...@@ -52,6 +52,7 @@ window.MergeConflictDataProvider = class MergeConflictDataProvider {
setParallelLines(data) { setParallelLines(data) {
data.files.forEach( (file) => { data.files.forEach( (file) => {
file.filePath = this.getFilePath(file);
file.parallelLines = { left: [], right: [] }; file.parallelLines = { left: [], right: [] };
file.sections.forEach( (section) => { file.sections.forEach( (section) => {
...@@ -110,6 +111,7 @@ window.MergeConflictDataProvider = class MergeConflictDataProvider { ...@@ -110,6 +111,7 @@ window.MergeConflictDataProvider = class MergeConflictDataProvider {
setInlineLines(data) { setInlineLines(data) {
data.files.forEach( (file) => { data.files.forEach( (file) => {
file.inlineLines = [] file.inlineLines = []
file.filePath = this.getFilePath(file);
file.sections.forEach( (section) => { file.sections.forEach( (section) => {
let currentLineType = 'new'; let currentLineType = 'new';
...@@ -292,4 +294,10 @@ window.MergeConflictDataProvider = class MergeConflictDataProvider { ...@@ -292,4 +294,10 @@ window.MergeConflictDataProvider = class MergeConflictDataProvider {
} }
} }
getFilePath(file) {
const { old_path, new_path } = file;
return old_path === new_path ? new_path : `${old_path} → ${new_path}`;
}
} }
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
.files{"v-if" => "isParallel"} .files{"v-if" => "isParallel"}
.diff-file.file-holder.conflict.parallel-view{"v-for" => "file in conflictsData.files"} .diff-file.file-holder.conflict.parallel-view{"v-for" => "file in conflictsData.files"}
.file-title .file-title
%span {{file.new_path}} %span {{{file.filePath}}}
.file-actions .file-actions
%a.btn.btn-sm View file @{{conflictsData.shortCommitSha}} %a.btn.btn-sm View file @{{conflictsData.shortCommitSha}}
...@@ -66,10 +66,11 @@ ...@@ -66,10 +66,11 @@
%td.line_content %td.line_content
{{{line.richText}}} {{{line.richText}}}
.files{"v-if" => "!isParallel"} .files{"v-if" => "!isParallel"}
.diff-file.file-holder.conflict.inline-view{"v-for" => "file in conflictsData.files"} .diff-file.file-holder.conflict.inline-view{"v-for" => "file in conflictsData.files"}
.file-title .file-title
%span {{file.new_path}} %span {{{file.filePath}}}
.file-actions .file-actions
%a.btn.btn-sm View file @{{conflictsData.shortCommitSha}} %a.btn.btn-sm View file @{{conflictsData.shortCommitSha}}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment