Skip to content

Commit

Permalink
Fixes issue with open revision in quickpicks
Browse files Browse the repository at this point in the history
  • Loading branch information
eamodio committed May 21, 2019
1 parent f4ce2d2 commit 75446f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/commands/openInRemote.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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)} ${
Expand Down
5 changes: 2 additions & 3 deletions src/quickpicks/remotesQuickPick.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { Commands, OpenInRemoteCommandArgs } from '../commands';
import { GlyphChars } from '../constants';
import {
getNameFromRemoteResource,
GitLogCommit,
GitRemote,
GitService,
RemoteResource,
Expand Down Expand Up @@ -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 ${
Expand All @@ -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}` : ''
}`;
Expand Down

0 comments on commit 75446f9

Please sign in to comment.