mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-10 16:58:55 -05:00
Git - do not show repositories in the empty window (#292804)
This commit is contained in:
@@ -957,11 +957,14 @@ export class Repository implements Disposable {
|
||||
: new ThemeIcon('repo');
|
||||
|
||||
// Hidden
|
||||
// This is a temporary solution to hide worktrees created by Copilot
|
||||
// when the main repository is opened. Users can still manually open
|
||||
// the worktree from the Repositories view.
|
||||
this._isHidden = repository.kind === 'worktree' &&
|
||||
isCopilotWorktree(repository.root) && parent !== undefined;
|
||||
// This is a temporary solution to hide:
|
||||
// * repositories in the empty window
|
||||
// * worktrees created by Copilot when the main repository
|
||||
// is opened. Users can still manually open the worktree
|
||||
// from the Repositories view.
|
||||
this._isHidden = workspace.workspaceFolders === undefined ||
|
||||
(repository.kind === 'worktree' &&
|
||||
isCopilotWorktree(repository.root) && parent !== undefined);
|
||||
|
||||
const root = Uri.file(repository.root);
|
||||
this._sourceControl = scm.createSourceControl('git', 'Git', root, icon, this._isHidden, parent);
|
||||
|
||||
@@ -292,13 +292,17 @@ export class StatusBarCommands {
|
||||
private checkoutStatusBar: CheckoutStatusBar;
|
||||
private disposables: Disposable[] = [];
|
||||
|
||||
constructor(repository: Repository, remoteSourcePublisherRegistry: IRemoteSourcePublisherRegistry) {
|
||||
constructor(private readonly repository: Repository, remoteSourcePublisherRegistry: IRemoteSourcePublisherRegistry) {
|
||||
this.syncStatusBar = new SyncStatusBar(repository, remoteSourcePublisherRegistry);
|
||||
this.checkoutStatusBar = new CheckoutStatusBar(repository);
|
||||
this.onDidChange = anyEvent(this.syncStatusBar.onDidChange, this.checkoutStatusBar.onDidChange);
|
||||
}
|
||||
|
||||
get commands(): Command[] {
|
||||
if (this.repository.isHidden) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return [this.checkoutStatusBar.command, this.syncStatusBar.command]
|
||||
.filter((c): c is Command => !!c);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user