Handle renamed files in file header.

This commit is contained in:
Fatih Acet 2016-08-02 23:27:37 +03:00
parent 29bed9967b
commit e47e537b07
2 changed files with 11 additions and 2 deletions

View file

@ -52,6 +52,7 @@ window.MergeConflictDataProvider = class MergeConflictDataProvider {
setParallelLines(data) {
data.files.forEach( (file) => {
file.filePath = this.getFilePath(file);
file.parallelLines = { left: [], right: [] };
file.sections.forEach( (section) => {
@ -110,6 +111,7 @@ window.MergeConflictDataProvider = class MergeConflictDataProvider {
setInlineLines(data) {
data.files.forEach( (file) => {
file.inlineLines = []
file.filePath = this.getFilePath(file);
file.sections.forEach( (section) => {
let currentLineType = 'new';
@ -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}`;
}
}

View file

@ -39,7 +39,7 @@
.files{"v-if" => "isParallel"}
.diff-file.file-holder.conflict.parallel-view{"v-for" => "file in conflictsData.files"}
.file-title
%span {{file.new_path}}
%span {{{file.filePath}}}
.file-actions
%a.btn.btn-sm View file @{{conflictsData.shortCommitSha}}
@ -66,10 +66,11 @@
%td.line_content
{{{line.richText}}}
.files{"v-if" => "!isParallel"}
.diff-file.file-holder.conflict.inline-view{"v-for" => "file in conflictsData.files"}
.file-title
%span {{file.new_path}}
%span {{{file.filePath}}}
.file-actions
%a.btn.btn-sm View file @{{conflictsData.shortCommitSha}}