mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-17 23:35:54 +01:00
Sessions - source control providers do not need the parent/child relationship (#304830)
This commit is contained in:
@@ -941,12 +941,17 @@ export class Repository implements Disposable {
|
||||
|
||||
this.disposables.push(new FileEventLogger(onRepositoryWorkingTreeFileChange, onRepositoryDotGitFileChange, logger));
|
||||
|
||||
// Parent source control
|
||||
const parentRoot = repository.kind === 'submodule'
|
||||
? repository.dotGit.superProjectPath
|
||||
: repository.kind === 'worktree' && repository.dotGit.commonPath
|
||||
? path.dirname(repository.dotGit.commonPath)
|
||||
: undefined;
|
||||
// Parent source control. Repositories opened in the Sessions app
|
||||
// don't use the parent/child relationship and it is expected for
|
||||
// a worktree repository to be opened while the main repository
|
||||
// is closed.
|
||||
const parentRoot = workspace.isAgentSessionsWorkspace
|
||||
? undefined
|
||||
: repository.kind === 'submodule'
|
||||
? repository.dotGit.superProjectPath
|
||||
: repository.kind === 'worktree' && repository.dotGit.commonPath
|
||||
? path.dirname(repository.dotGit.commonPath)
|
||||
: undefined;
|
||||
const parent = parentRoot
|
||||
? this.repositoryResolver.getRepository(parentRoot)?.sourceControl
|
||||
: undefined;
|
||||
|
||||
Reference in New Issue
Block a user