Skip to content

Commit e6d6ee7

Browse files
committed
Adds better fallback for missing suffixes
1 parent d5f8892 commit e6d6ee7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/commands/diffWith.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,11 @@ export class DiffWithCommand extends ActiveEditorCommand {
126126
rhsSuffix = 'not in Working Tree';
127127
}
128128
else {
129-
rhsSuffix = `deleted in ${rhsSuffix}`;
129+
rhsSuffix = `deleted${rhsSuffix.length === 0 ? '' : ` in ${rhsSuffix}`}`;
130130
}
131131
}
132132
else if (lhs === undefined) {
133-
rhsSuffix = `added in ${rhsSuffix}`;
133+
rhsSuffix = `added${rhsSuffix.length === 0 ? '' : ` in ${rhsSuffix}`}`;
134134
}
135135

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

0 commit comments

Comments
 (0)