1
>
/*---------------------------------------------------------------------------------------------
copilotGitProject.ts
2
>
* Copyright (c) Microsoft Corporation. All rights reserved.
3
>
* Licensed under the MIT License. See License.txt in the project root for license information.
4
>
*--------------------------------------------------------------------------------------------*/
5
>
6
>
import { Schemas } from '../../../../base/common/network.js';
7
>
import { basename } from '../../../../base/common/path.js';
8
>
import { URI } from '../../../../base/common/uri.js';
9
>
import type { IAgentSessionProjectInfo } from '../../common/agentService.js';
10
>
import type { IAgentHostGitService } from '../../common/agentHostGitService.js';
11
>
12
>
export interface ICopilotSessionContext {
13
>
readonly cwd?: string;
14
>
readonly gitRoot?: string;
15
>
readonly repository?: string;
16
>
}
17
>
18
export async function resolveGitProject(workingDirectory: URI | undefined, gitService: IAgentHostGitService): Promise<IAgentSessionProjectInfo | undefined> {
19
if (!workingDirectory || workingDirectory.scheme !== Schemas.file) {