diff --git a/src/commands/openInRemote.ts b/src/commands/openInRemote.ts index ad63319..08a0db5 100644 --- a/src/commands/openInRemote.ts +++ b/src/commands/openInRemote.ts @@ -1,7 +1,7 @@ 'use strict'; import { TextEditor, Uri } from 'vscode'; import { GlyphChars } from '../constants'; -import { GitLogCommit, GitRemote, GitService, RemoteResource, RemoteResourceType } from '../git/gitService'; +import { GitRemote, GitService, RemoteResource, RemoteResourceType } from '../git/gitService'; import { Logger } from '../logger'; import { Messages } from '../messages'; import { CommandQuickPickItem, OpenRemoteCommandQuickPickItem, RemotesQuickPick } from '../quickpicks'; @@ -68,7 +68,7 @@ export class OpenInRemoteCommand extends ActiveEditorCommand { break; case RemoteResourceType.Revision: - if (args.resource.commit !== undefined && args.resource.commit instanceof GitLogCommit) { + if (args.resource.commit !== undefined && args.resource.commit.isFile) { if (args.resource.commit.status === 'D') { args.resource.sha = args.resource.commit.previousSha; placeHolder = `${verb} ${args.resource.fileName} ${Strings.pad(GlyphChars.Dot, 1, 1)} ${ diff --git a/src/quickpicks/remotesQuickPick.ts b/src/quickpicks/remotesQuickPick.ts index fd1e36d..61a5475 100644 --- a/src/quickpicks/remotesQuickPick.ts +++ b/src/quickpicks/remotesQuickPick.ts @@ -5,7 +5,6 @@ import { Commands, OpenInRemoteCommandArgs } from '../commands'; import { GlyphChars } from '../constants'; import { getNameFromRemoteResource, - GitLogCommit, GitRemote, GitService, RemoteResource, @@ -70,7 +69,7 @@ export class OpenRemotesCommandQuickPickItem extends CommandQuickPickItem { break; case RemoteResourceType.Revision: - if (resource.commit !== undefined && resource.commit instanceof GitLogCommit) { + if (resource.commit !== undefined && resource.commit.isFile) { if (resource.commit.status === 'D') { resource.sha = resource.commit.previousSha; description = `$(file-text) ${paths.basename(resource.fileName)} in ${ @@ -87,7 +86,7 @@ export class OpenRemotesCommandQuickPickItem extends CommandQuickPickItem { } } else { - const shortFileSha = resource.sha === undefined ? '=' : GitService.shortenSha(resource.sha); + const shortFileSha = resource.sha === undefined ? '' : GitService.shortenSha(resource.sha); description = `$(file-text) ${paths.basename(resource.fileName)}${ shortFileSha ? ` in ${GlyphChars.Space}$(git-commit) ${shortFileSha}` : '' }`;