Skip to content

Commit cbe5a49

Browse files
committed
Improves worktree handling
- Adds header to allow persistent repo filtering to tree views - Improves repository picker -- visually groups repos + worktrees - Debounces SCM repo open/close events to prevent excessive chugging
1 parent 13b7f97 commit cbe5a49

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+575
-247
lines changed

src/commands/closeUnchangedFiles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export class CloseUnchangedFilesCommand extends GlCommandBase {
2323

2424
try {
2525
if (args.uris == null) {
26-
const repo = await getRepositoryOrShowPicker('Close All Unchanged Files');
26+
const repo = await getRepositoryOrShowPicker(this.container, 'Close All Unchanged Files');
2727
if (repo == null) return;
2828

2929
const status = await repo.git.status.getStatus();

src/commands/compareWith.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export class CompareWithCommand extends ActiveEditorCommand {
6565
break;
6666
}
6767

68-
const repoPath = (await getBestRepositoryOrShowPicker(uri, editor, title))?.path;
68+
const repoPath = (await getBestRepositoryOrShowPicker(this.container, uri, editor, title))?.path;
6969
if (!repoPath) return;
7070

7171
if (args.ref1 != null && args.ref2 != null) {

src/commands/copyCurrentBranch.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ export class CopyCurrentBranchCommand extends ActiveEditorCommand {
2020

2121
const gitUri = uri != null ? await GitUri.fromUri(uri) : undefined;
2222

23-
const repository = await getBestRepositoryOrShowPicker(gitUri, editor, 'Copy Current Branch Name');
23+
const repository = await getBestRepositoryOrShowPicker(
24+
this.container,
25+
gitUri,
26+
editor,
27+
'Copy Current Branch Name',
28+
);
2429
if (repository == null) return;
2530

2631
try {

src/commands/copyDeepLink.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,12 @@ export class CopyDeepLinkCommand extends ActiveEditorCommand {
100100

101101
type = DeepLinkType.Repository;
102102
repoPath = (
103-
await getBestRepositoryOrShowPicker(gitUri, editor, `Copy Link to ${deepLinkTypeToString(type)}`)
103+
await getBestRepositoryOrShowPicker(
104+
this.container,
105+
gitUri,
106+
editor,
107+
`Copy Link to ${deepLinkTypeToString(type)}`,
108+
)
104109
)?.path;
105110
} else if (typeof args.refOrRepoPath === 'string') {
106111
type = args.compareRef == null ? DeepLinkType.Repository : DeepLinkType.Comparison;

src/commands/createPullRequestOnRemote.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export class CreatePullRequestOnRemoteCommand extends GlCommandBase {
3333
if (args?.repoPath != null) {
3434
repo = this.container.git.getRepository(args.repoPath);
3535
}
36-
repo ??= await getRepositoryOrShowPicker('Create Pull Request', undefined, undefined);
36+
repo ??= await getRepositoryOrShowPicker(this.container, 'Create Pull Request', undefined, undefined);
3737
if (repo == null) return;
3838

3939
if (args == null) {

src/commands/diffFolderWithRevision.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,12 @@ export class DiffFolderWithRevisionCommand extends ActiveEditorCommand {
4141
const gitUri = await GitUri.fromUri(uri);
4242

4343
try {
44-
const repo = await getBestRepositoryOrShowPicker(uri, editor, `Open Folder Changes with Revision`);
44+
const repo = await getBestRepositoryOrShowPicker(
45+
this.container,
46+
uri,
47+
editor,
48+
`Open Folder Changes with Revision`,
49+
);
4550
if (repo == null) return;
4651

4752
const log = repo.git.commits

src/commands/diffFolderWithRevisionFrom.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,12 @@ export class DiffFolderWithRevisionFromCommand extends ActiveEditorCommand {
3939

4040
try {
4141
const repoPath = (
42-
await getBestRepositoryOrShowPicker(uri, editor, 'Open Folder Changes with Branch or Tag')
42+
await getBestRepositoryOrShowPicker(
43+
this.container,
44+
uri,
45+
editor,
46+
'Open Folder Changes with Branch or Tag',
47+
)
4348
)?.path;
4449
if (!repoPath) return;
4550

src/commands/explainBase.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export abstract class ExplainCommandBase extends GlCommandBase {
4545
uri = getCommandUri(uri, editor);
4646
const gitUri = uri != null ? await GitUri.fromUri(uri) : undefined;
4747
const repository = await getBestRepositoryOrShowPicker(
48+
this.container,
4849
gitUri,
4950
editor,
5051
this.pickerTitle,

src/commands/externalDiff.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export class ExternalDiffCommand extends GlCommandBase {
8585

8686
if (context.command === 'gitlens.externalDiffAll') {
8787
if (args.files == null) {
88-
const repository = await getRepositoryOrShowPicker('Open All Changes (difftool)');
88+
const repository = await getRepositoryOrShowPicker(this.container, 'Open All Changes (difftool)');
8989
if (repository == null) return;
9090

9191
const status = await this.container.git.getRepositoryService(repository.uri).status.getStatus();

src/commands/generateCommitMessage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export class GenerateCommitMessageCommand extends ActiveEditorCommand {
5757

5858
const gitUri = uri != null ? await GitUri.fromUri(uri) : undefined;
5959

60-
repo = await getBestRepositoryOrShowPicker(gitUri, editor, 'Generate Commit Message');
60+
repo = await getBestRepositoryOrShowPicker(this.container, gitUri, editor, 'Generate Commit Message');
6161
}
6262
if (repo == null) return;
6363

0 commit comments

Comments
 (0)