Skip to content

Commit

Permalink
Adds better fallback for missing suffixes
Browse files Browse the repository at this point in the history
  • Loading branch information
eamodio committed May 15, 2019
1 parent d5f8892 commit e6d6ee7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/commands/diffWith.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@ export class DiffWithCommand extends ActiveEditorCommand {
rhsSuffix = 'not in Working Tree';
}
else {
rhsSuffix = `deleted in ${rhsSuffix}`;
rhsSuffix = `deleted${rhsSuffix.length === 0 ? '' : ` in ${rhsSuffix}`}`;
}
}
else if (lhs === undefined) {
rhsSuffix = `added in ${rhsSuffix}`;
rhsSuffix = `added${rhsSuffix.length === 0 ? '' : ` in ${rhsSuffix}`}`;
}

let lhsSuffix = args.lhs.sha !== GitService.deletedOrMissingSha ? GitService.shortenSha(lhsSha) || '' : '';
Expand All @@ -140,7 +140,7 @@ export class DiffWithCommand extends ActiveEditorCommand {
rhsSuffix = '';
}
else {
lhsSuffix = `deleted in ${lhsSuffix})`;
lhsSuffix = `deleted${lhsSuffix.length === 0 ? '' : ` in ${lhsSuffix}`}`;
}
}

Expand Down

0 comments on commit e6d6ee7

Please sign in to comment.