Ver a proveniência

Changes commit search to prompt for repo

main
Eric Amodio há 5 anos
ascendente
cometimento
bfcce3b752
8 ficheiros alterados com 8 adições e 22 eliminações
  1. +0
    -1
      src/commands/closeUnchangedFiles.ts
  2. +1
    -5
      src/commands/common.ts
  3. +1
    -4
      src/commands/externalDiff.ts
  4. +0
    -1
      src/commands/openChangedFiles.ts
  5. +3
    -7
      src/commands/searchCommits.ts
  6. +0
    -1
      src/commands/stashApply.ts
  7. +2
    -2
      src/commands/stashSave.ts
  8. +1
    -1
      src/views/nodes/compareNode.ts

+ 0
- 1
src/commands/closeUnchangedFiles.ts Ver ficheiro

@ -28,7 +28,6 @@ export class CloseUnchangedFilesCommand extends ActiveEditorCommand {
args = { ...args };
const repoPath = await getRepoPathOrPrompt(
undefined,
`Close all files except those changed in which repository${GlyphChars.Ellipsis}`
);
if (!repoPath) return undefined;

+ 1
- 5
src/commands/common.ts Ver ficheiro

@ -166,11 +166,7 @@ export async function getRepoPathOrActiveOrPrompt(
return repoPath;
}
export async function getRepoPathOrPrompt(
uri: Uri | undefined,
placeholder: string,
goBackCommand?: CommandQuickPickItem
) {
export async function getRepoPathOrPrompt(placeholder: string, goBackCommand?: CommandQuickPickItem, uri?: Uri) {
let repoPath = await Container.git.getRepoPath(uri);
if (!repoPath) {
const pick = await RepositoriesQuickPick.show(placeholder, goBackCommand);

+ 1
- 4
src/commands/externalDiff.ts Ver ficheiro

@ -124,10 +124,7 @@ export class ExternalDiffCommand extends Command {
if (context.command === Commands.ExternalDiffAll) {
if (args.files === undefined) {
const repoPath = await getRepoPathOrPrompt(
undefined,
`Open changes from which repository${GlyphChars.Ellipsis}`
);
const repoPath = await getRepoPathOrPrompt(`Open changes from which repository${GlyphChars.Ellipsis}`);
if (!repoPath) return undefined;
const status = await Container.git.getStatusForRepo(repoPath);

+ 0
- 1
src/commands/openChangedFiles.ts Ver ficheiro

@ -25,7 +25,6 @@ export class OpenChangedFilesCommand extends ActiveEditorCommand {
args = { ...args };
const repoPath = await getRepoPathOrPrompt(
undefined,
`Open all files changed in which repository${GlyphChars.Ellipsis}`
);
if (!repoPath) return undefined;

+ 3
- 7
src/commands/searchCommits.ts Ver ficheiro

@ -2,7 +2,7 @@
import { commands, InputBoxOptions, TextEditor, Uri, window } from 'vscode';
import { GlyphChars } from '../constants';
import { Container } from '../container';
import { GitRepoSearchBy, GitService, GitUri } from '../git/gitService';
import { GitRepoSearchBy, GitService } from '../git/gitService';
import { Logger } from '../logger';
import { Messages } from '../messages';
import { CommandQuickPickItem, CommitsQuickPick, ShowCommitSearchResultsInViewQuickPickItem } from '../quickpicks';
@ -14,7 +14,7 @@ import {
CommandContext,
Commands,
getCommandUri,
getRepoPathOrActiveOrPrompt,
getRepoPathOrPrompt,
isCommandViewContextWithRepo
} from './common';
import { ShowQuickCommitDetailsCommandArgs } from './showQuickCommitDetails';
@ -80,11 +80,7 @@ export class SearchCommitsCommand extends ActiveEditorCachedCommand {
async execute(editor?: TextEditor, uri?: Uri, args: SearchCommitsCommandArgs = {}) {
uri = getCommandUri(uri, editor);
const gitUri = uri && (await GitUri.fromUri(uri));
const repoPath = await getRepoPathOrActiveOrPrompt(
gitUri,
editor,
const repoPath = await getRepoPathOrPrompt(
`Search for commits in which repository${GlyphChars.Ellipsis}`,
args.goBackCommand
);

+ 0
- 1
src/commands/stashApply.ts Ver ficheiro

@ -52,7 +52,6 @@ export class StashApplyCommand extends Command {
if (args.stashItem === undefined || args.stashItem.stashName === undefined) {
if (args.repoPath === undefined) {
args.repoPath = await getRepoPathOrPrompt(
undefined,
`Apply stashed changes from which repository${GlyphChars.Ellipsis}`,
args.goBackCommand
);

+ 2
- 2
src/commands/stashSave.ts Ver ficheiro

@ -65,9 +65,9 @@ export class StashSaveCommand extends Command {
const uri = args.uris !== undefined && args.uris.length !== 0 ? args.uris[0] : undefined;
if (args.repoPath === undefined) {
args.repoPath = await getRepoPathOrPrompt(
uri,
`Stash changes for which repository${GlyphChars.Ellipsis}`,
args.goBackCommand
args.goBackCommand,
uri
);
}
if (!args.repoPath) return undefined;

+ 1
- 1
src/views/nodes/compareNode.ts Ver ficheiro

@ -163,7 +163,7 @@ export class CompareNode extends ViewNode {
async selectForCompare(repoPath?: string, ref?: string | NamedRef) {
if (repoPath === undefined) {
repoPath = await getRepoPathOrPrompt(undefined, `Compare in which repository${GlyphChars.Ellipsis}`);
repoPath = await getRepoPathOrPrompt(`Compare in which repository${GlyphChars.Ellipsis}`);
}
if (repoPath === undefined) return;

Carregando…
Cancelar
Guardar