Skip to content

Commit 8a87713

Browse files
committed
Shortens refs
1 parent 9113cd8 commit 8a87713

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/commands/diffWithBranch.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as paths from 'path';
33
import { commands, TextDocumentShowOptions, TextEditor, Uri } from 'vscode';
44
import { GlyphChars } from '../constants';
55
import { Container } from '../container';
6-
import { GitUri } from '../git/gitService';
6+
import { GitService, GitUri } from '../git/gitService';
77
import { Messages } from '../messages';
88
import { BranchesAndTagsQuickPick, CommandQuickPickItem } from '../quickpicks';
99
import { Strings } from '../system';
@@ -59,7 +59,7 @@ export class DiffWithBranchCommand extends ActiveEditorCommand {
5959
const rename = files.find(s => s.fileName === fileName);
6060
if (rename !== undefined && rename.originalFileName !== undefined) {
6161
renamedUri = GitUri.resolveToUri(rename.originalFileName, gitUri.repoPath);
62-
renamedTitle = `${paths.basename(rename.originalFileName)} (${ref})`;
62+
renamedTitle = `${paths.basename(rename.originalFileName)} (${GitService.shortenSha(ref)})`;
6363
}
6464
}
6565

@@ -68,7 +68,7 @@ export class DiffWithBranchCommand extends ActiveEditorCommand {
6868
lhs: {
6969
sha: pick.remote ? `remotes/${ref}` : ref,
7070
uri: renamedUri || (gitUri as Uri),
71-
title: renamedTitle || `${paths.basename(gitUri.fsPath)} (${ref})`
71+
title: renamedTitle || `${paths.basename(gitUri.fsPath)} (${GitService.shortenSha(ref)})`
7272
},
7373
rhs: {
7474
sha: '',

0 commit comments

Comments
 (0)