/// import * as child_process from 'child_process'; import { type GitRepoInfo } from 'git-repo-info'; /** * @alpha */ export interface IExecuteGitCommandParams { args: string[]; workingDirectory?: string; } /** * @alpha */ export type IObjectType = 'blob' | 'tag' | 'commit' | 'tree'; /** * Help class for git operations * * @alpha */ export declare class GitService { private _checkedGitPath; private _gitPath; private _gitUser; private _gitEmail; private _isSparseCheckoutMode; private _terminalService; private _telemetryService; private _commandService; setGitConfig(k: string, v: string | number | boolean, option?: { dryRun?: boolean; global?: boolean; replaceAll?: boolean; add?: boolean; }): void; getGitConfig(k: string, option?: { dryRun?: boolean; global?: boolean; array?: boolean; }): string | undefined; unsetGitConfig(k: string): void; setRecommendConfig(option?: { overwrite?: boolean; dryRun?: boolean; }): void; getGitUser(): string | undefined; getGitEmail(): string | undefined; getIsSparseCheckoutMode(): boolean | undefined; /** * Returns the path to the GitService binary if found. Otherwise, return undefined. */ get gitPath(): string | undefined; getGitPathOrThrow(): string; executeGitCommand({ args, workingDirectory }: IExecuteGitCommandParams): child_process.SpawnSyncReturns; executeGitCommandAndCaptureOutput({ args, workingDirectory }: IExecuteGitCommandParams): string; /** * Get the humanish basename from the URL * * The implementation aligns with the git source code at * https://github.com/git/git/blob/3e0d3cd5c7def4808247caf168e17f2bbf47892b/dir.c#L3175 */ getBasenameFromUrl(url: string): string; getRepoInfo(): GitRepoInfo; getBranchRemote(branch: string): string; getGitVersion(): [number, number, number] | undefined; hasFile(filename: string, branch: string): boolean; getObjectType(object: string): IObjectType | undefined; getCurrentBranch(): string; /** * Retrieves the previous branch name using `@{-n}` syntax * * Assume: * git checkout feature * git checkout main * --- * `git checkout @{-1}` equals to run `git checkout feature`. * Running `getPreviousBranch(1)` works in the similar way and returns "feature" in this case. */ getPreviousBranch(n: number): string; /** * Check existence for a list of branch name */ checkRemoteBranchesExistenceAsync: (remote: string, branches: string[]) => Promise>; /** * Check existence for one branch name. * * Function "checkRemoteBranchesExistenceAsync" is preferred if you are going to check a list of branch name. */ checkRemoteBranchExistenceAsync: (remote: string, branch: string) => Promise; private _processResult; } //# sourceMappingURL=GitService.d.ts.map