豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Commit 974cb49

Browse files
authored
Background - remove workaround for viewing background session changes in the empty window (#4118)
* Revert "Ensure the repo is opened to get diffing working in sesions window (#3988)" This reverts commit 3a0383c. * Background - remove workaround for viewing background session changes in the empty window
1 parent e88ee70 commit 974cb49

File tree

1 file changed

+13
-21
lines changed

1 file changed

+13
-21
lines changed

src/extension/chatSessions/vscode-node/copilotCLIChatSessionsContribution.ts

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { ITelemetryService } from '../../../platform/telemetry/common/telemetry'
1919
import { IWorkspaceService } from '../../../platform/workspace/common/workspaceService';
2020
import { isUri } from '../../../util/common/types';
2121
import { DeferredPromise } from '../../../util/vs/base/common/async';
22+
import { CancellationToken } from '../../../util/vs/base/common/cancellation';
2223
import { isCancellationError } from '../../../util/vs/base/common/errors';
2324
import { Emitter, Event } from '../../../util/vs/base/common/event';
2425
import { Disposable, DisposableStore, IDisposable, IReference, toDisposable } from '../../../util/vs/base/common/lifecycle';
@@ -44,7 +45,6 @@ import { isCopilotCLIPlanAgent } from './copilotCLIPlanAgentProvider';
4445
import { convertReferenceToVariable } from './copilotCLIPromptReferences';
4546
import { ICopilotCLITerminalIntegration, TerminalOpenLocation } from './copilotCLITerminalIntegration';
4647
import { CopilotCloudSessionsProvider } from './copilotCloudSessionsProvider';
47-
import { CancellationToken } from '../../../util/vs/base/common/cancellation';
4848

4949
const AGENTS_OPTION_ID = 'agent';
5050
const REPOSITORY_OPTION_ID = 'repository';
@@ -509,28 +509,20 @@ export class CopilotCLIChatSessionContentProvider extends Disposable implements
509509
};
510510
}
511511
const worktreeProperties = await this.copilotCLIWorktreeManagerService.getWorktreeProperties(copilotcliSessionId);
512-
// Ensure that the repository for the background session is opened. This is needed
513-
// when the background session is opened in the empty window so that we can access
514-
// the changes of the background session.
515-
if (worktreeProperties?.repositoryPath) {
516-
const repoUri = vscode.Uri.file(worktreeProperties.repositoryPath);
517-
await this.gitService.getRepository(repoUri);
518-
// Ensure the repo is opened so we can compute the diff of the files.
519-
await this.gitService.getRepository(vscode.Uri.file(worktreeProperties.worktreePath));
520-
if (isBranchOptionFeatureEnabled(this.configurationService)) {
521-
const branchName = worktreeProperties.version === 1
522-
? worktreeProperties.branchName
523-
: worktreeProperties.baseBranchName;
512+
if (worktreeProperties?.repositoryPath && isBranchOptionFeatureEnabled(this.configurationService)) {
513+
const branchName = worktreeProperties.version === 1
514+
? worktreeProperties.branchName
515+
: worktreeProperties.baseBranchName;
524516

525-
this._selectedRepoForBranches = { repoUri, headBranchName: branchName };
517+
const repoUri = vscode.Uri.file(worktreeProperties.repositoryPath);
518+
this._selectedRepoForBranches = { repoUri, headBranchName: branchName };
526519

527-
options[BRANCH_OPTION_ID] = {
528-
id: branchName,
529-
name: branchName,
530-
icon: new vscode.ThemeIcon('git-branch'),
531-
locked: true
532-
};
533-
}
520+
options[BRANCH_OPTION_ID] = {
521+
id: branchName,
522+
name: branchName,
523+
icon: new vscode.ThemeIcon('git-branch'),
524+
locked: true
525+
};
534526
}
535527
if (isIsolationOptionFeatureEnabled(this.configurationService)) {
536528
const isWorktree = !!worktreeProperties;

0 commit comments

Comments
 (0)