Преглед на файлове

Fixes issue with open revision in quickpicks

main
Eric Amodio преди 5 години
родител
ревизия
75446f9ff3
променени са 2 файла, в които са добавени 4 реда и са изтрити 5 реда
  1. +2
    -2
      src/commands/openInRemote.ts
  2. +2
    -3
      src/quickpicks/remotesQuickPick.ts

+ 2
- 2
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)} ${

+ 2
- 3
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}` : ''
}`;

Зареждане…
Отказ
Запис