git-local-info
Version:
Retrieve current sha, branch name, repository from a git repo.
22 lines (21 loc) • 611 B
TypeScript
import { IGitInfo, IGitInfoParams } from './typings';
export default class GitInfo {
readonly getGitInfo: IGitInfo;
private gitPath;
private GIT_DIR;
private 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;
}