import { Logger } from "../../bll/utils/logger" ; import { CvsSupportProvider } from "../cvsprovider" ; import { CvsResource } from "../../bll/entities/cvsresources/cvsresource" ; import { CheckInInfo } from "../../bll/entities/checkininfo" ; import { ReadableSet } from "../../bll/utils/readableset" ; import { UriProxy } from "../../bll/moduleproxies/uri-proxy" ; import { Uri } from "vscode" ; import { GitStatusCommand } from "./GitStatusCommand" ; import { GitCommandsFactory } from "./GitCommandsFactory" ; export class GitProvider implements CvsSupportProvider { private readonly workspaceRootPath : string ; public constructor ( private readonly workspaceRootPathAsUri , private readonly gitPath , private readonly commandFactory ) { this . workspaceRootPath = workspaceRootPathAsUri . fsPath ; } public async getRequiredCheckInInfo ( ) { Logger . logDebug ( `GitSupportProvider#getRequiredCheckinInfo: start getting local cvs resources` ) ; const cvsLocalResources = await this . getChanges ( ) ; Logger . logDebug ( `GitSupportProvider#getRequiredCheckinInfo: found ${ cvsLocalResources ? "not " : "" }empty` ) ; return new CheckInInfo ( cvsLocalResources , this , this . workspaceRootPath ) ; } private async getChanges ( ) { const statusCommand = await this . commandFactory . getStatusCommand ( ) ; return statusCommand . execute ( ) ; } public async getStagedFileContentStream ( cvsResource ) { return this . commandFactory . getStagedFileContentStreamCommand ( cvsResource ) . execute ( ) ; } public async commit ( checkInInfo ) { Logger . logWarning ( "GitProvider#commit: the operation is not supported." ) ; return Promise . resolve ( ) ; } public getRootPath ( ) { return this . workspaceRootPathAsUri . path ; } public async getRepoBranchName ( ) { return this . commandFactory . getRepoBranchNameCommand ( ) . execute ( ) ; } }