756
757
private async _readWorktreeMetadata(sessionUri: URI): Promise<{ branchName: string; worktreePath?: URI; repositoryRoot?: URI } | undefined> {
759
>
if (!ref) {
760
return undefined;
761
}
763
>
const [branchName, worktreePathRaw, repositoryRootRaw] = await Promise.all([
764
>
ref.object.getMetadata(WORKTREE_META_BRANCH),
765
>
ref.object.getMetadata(WORKTREE_META_PATH),
766
>
ref.object.getMetadata(WORKTREE_META_REPOSITORY_ROOT),
767
>
]);
768
>
if (!branchName) {
769
return undefined;
770
}
771
>
const worktreePath = worktreePathRaw ? URI.parse(worktreePathRaw) : undefined;
worktreeIsolation.ts
772
>
const repositoryRoot = repositoryRootRaw ? URI.parse(repositoryRootRaw) : undefined;
773
>
return { branchName, worktreePath, repositoryRoot };
774
>
} finally {
775
>
ref.dispose();
776
>
}
777
>
}
778
779
private async _isSessionArchived(sessionUri: URI): Promise<boolean> {