From 26fc11f9dfdb387a2e01dcee34d51d23b49e5704 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Tue, 4 Sep 2018 02:54:36 -0400 Subject: [PATCH] Fixes path formatting & adds optional suffix --- src/commands/diffWithRevision.ts | 6 ++-- src/commands/openFileRevision.ts | 6 ++-- src/commands/showQuickFileHistory.ts | 6 ++-- src/git/formatters/statusFormatter.ts | 2 +- src/git/gitUri.ts | 27 +++++++----------- src/git/models/commit.ts | 4 +-- src/git/models/logCommit.ts | 16 +++++------ src/git/models/status.ts | 54 +++++++++++++++++++---------------- 8 files changed, 61 insertions(+), 60 deletions(-) diff --git a/src/commands/diffWithRevision.ts b/src/commands/diffWithRevision.ts index b8fe18c..72f7ed8 100644 --- a/src/commands/diffWithRevision.ts +++ b/src/commands/diffWithRevision.ts @@ -35,9 +35,9 @@ export class DiffWithRevisionCommand extends ActiveEditorCommand { const gitUri = await GitUri.fromUri(uri); - const placeHolder = `Compare ${gitUri.getFormattedPath( - args.branchOrTag ? ` (${args.branchOrTag.name})${Strings.pad(GlyphChars.Dot, 2, 2)}` : undefined - )}${gitUri.sha ? ` ${Strings.pad(GlyphChars.Dot, 1, 1)} ${gitUri.shortSha}` : ''} with revision${ + const placeHolder = `Compare ${gitUri.getFormattedPath({ + suffix: args.branchOrTag ? ` (${args.branchOrTag.name})` : undefined + })}${gitUri.sha ? ` ${Strings.pad(GlyphChars.Dot, 1, 1)} ${gitUri.shortSha}` : ''} with revision${ GlyphChars.Ellipsis }`; diff --git a/src/commands/openFileRevision.ts b/src/commands/openFileRevision.ts index f7b6347..e0fcde4 100644 --- a/src/commands/openFileRevision.ts +++ b/src/commands/openFileRevision.ts @@ -65,9 +65,9 @@ export class OpenFileRevisionCommand extends ActiveEditorCommand { const gitUri = await GitUri.fromUri(uri); - const placeHolder = `Open revision of ${gitUri.getFormattedPath( - args.branchOrTag ? ` (${args.branchOrTag.name})${Strings.pad(GlyphChars.Dot, 2, 2)}` : undefined - )}${gitUri.sha ? ` ${Strings.pad(GlyphChars.Dot, 1, 1)} ${gitUri.shortSha}` : ''}${ + const placeHolder = `Open revision of ${gitUri.getFormattedPath({ + suffix: args.branchOrTag ? ` (${args.branchOrTag.name})` : undefined + })}${gitUri.sha ? ` ${Strings.pad(GlyphChars.Dot, 1, 1)} ${gitUri.shortSha}` : ''}${ GlyphChars.Ellipsis }`; diff --git a/src/commands/showQuickFileHistory.ts b/src/commands/showQuickFileHistory.ts index ef2eb23..0140b30 100644 --- a/src/commands/showQuickFileHistory.ts +++ b/src/commands/showQuickFileHistory.ts @@ -39,9 +39,9 @@ export class ShowQuickFileHistoryCommand extends ActiveEditorCachedCommand { args = { ...args }; - const placeHolder = `${gitUri.getFormattedPath( - args.branchOrTag ? ` (${args.branchOrTag.name})${Strings.pad(GlyphChars.Dot, 2, 2)}` : undefined - )}${gitUri.sha ? ` ${Strings.pad(GlyphChars.Dot, 1, 1)} ${gitUri.shortSha}` : ''}`; + const placeHolder = `${gitUri.getFormattedPath({ + suffix: args.branchOrTag ? ` (${args.branchOrTag.name})` : undefined + })}${gitUri.sha ? ` ${Strings.pad(GlyphChars.Dot, 1, 1)} ${gitUri.shortSha}` : ''}`; const progressCancellation = FileHistoryQuickPick.showProgress(placeHolder); try { diff --git a/src/git/formatters/statusFormatter.ts b/src/git/formatters/statusFormatter.ts index 47229ea..e5017d3 100644 --- a/src/git/formatters/statusFormatter.ts +++ b/src/git/formatters/statusFormatter.ts @@ -30,7 +30,7 @@ export class StatusFileFormatter extends Formatter