Skip to content

Commit

Permalink
fix(conflicter): adjust diff message.
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed Sep 14, 2023
1 parent 91091ea commit 82a9e67
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions workspaces/conflicter/src/conflicter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,17 @@ export class Conflicter {
]);
}

destAdapter.log.colored([
{ message: '\n' },
{ message: 'removed', color: 'removed' },
{ message: '' },
{ message: 'added', color: 'added' },
{ message: '\n\n' },
...messages.flat(),
{ message: '\n\n' },
]);
if (messages) {
destAdapter.log.colored([
{ message: '\n' },
{ message: 'removed', color: 'removed' },
{ message: '' },
{ message: 'added', color: 'added' },
{ message: '\n\n' },
...messages.flat(),
{ message: '\n\n' },
]);
}
}

/**
Expand All @@ -202,7 +204,7 @@ export class Conflicter {
}

if (stat?.mode && diskStat.mode !== stat.mode) {
file.fileModeChanges = [Number.parseInt(stat.mode.toString(8), 10), Number.parseInt(diskStat.mode.toString(8), 10)];
file.fileModeChanges = [Number.parseInt(diskStat.mode.toString(8), 10), Number.parseInt(stat.mode.toString(8), 10)];
}

if (file.binary === undefined) {
Expand Down Expand Up @@ -231,7 +233,10 @@ export class Conflicter {
modified = (changes.length > 1 || changes[0].added || changes[0].removed) ?? false;
}

file.conflicterChanges = changes;
if (modified) {
file.conflicterChanges = changes;
}

return Boolean(file.fileModeChanges) || modified;
}

Expand Down

0 comments on commit 82a9e67

Please sign in to comment.