From 8a87713d685beef177015f3b06c5d3e393a62b22 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Wed, 30 Jan 2019 01:03:59 -0500 Subject: [PATCH] Shortens refs --- src/commands/diffWithBranch.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/commands/diffWithBranch.ts b/src/commands/diffWithBranch.ts index 1847f77..d1a0be1 100644 --- a/src/commands/diffWithBranch.ts +++ b/src/commands/diffWithBranch.ts @@ -3,7 +3,7 @@ import * as paths from 'path'; import { commands, TextDocumentShowOptions, TextEditor, Uri } from 'vscode'; import { GlyphChars } from '../constants'; import { Container } from '../container'; -import { GitUri } from '../git/gitService'; +import { GitService, GitUri } from '../git/gitService'; import { Messages } from '../messages'; import { BranchesAndTagsQuickPick, CommandQuickPickItem } from '../quickpicks'; import { Strings } from '../system'; @@ -59,7 +59,7 @@ export class DiffWithBranchCommand extends ActiveEditorCommand { const rename = files.find(s => s.fileName === fileName); if (rename !== undefined && rename.originalFileName !== undefined) { renamedUri = GitUri.resolveToUri(rename.originalFileName, gitUri.repoPath); - renamedTitle = `${paths.basename(rename.originalFileName)} (${ref})`; + renamedTitle = `${paths.basename(rename.originalFileName)} (${GitService.shortenSha(ref)})`; } } @@ -68,7 +68,7 @@ export class DiffWithBranchCommand extends ActiveEditorCommand { lhs: { sha: pick.remote ? `remotes/${ref}` : ref, uri: renamedUri || (gitUri as Uri), - title: renamedTitle || `${paths.basename(gitUri.fsPath)} (${ref})` + title: renamedTitle || `${paths.basename(gitUri.fsPath)} (${GitService.shortenSha(ref)})` }, rhs: { sha: '',