UNPKG

git-local-info-ts

Version:

Retrieve current sha, branch name, repository from a git repo.

23 lines (22 loc) 704 B
import { type IGitInfo, IGitInfoParams } from './typings'; export declare class GitInfo { get getGitInfo(): IGitInfo; private readonly gitPath; private readonly GIT_DIR; private readonly headPath; constructor(args?: IGitInfoParams); getBranch(): string; getRepository(): string; getSha(): string; getCommit(): any; private _findPackedCommit; private _getPackedRefsFile; private _getShaBasedOnType; private _getLinesForRefPath; private _doesLineMatchRefPath; private _getPackedRefsForType; private _readFile; private _findRepoHandleLinkedWorktree; private _findRepo; } export { type IGitInfo, type IGitInfoParams } from './typings';