export declare const gitUtil: { /** * 检出目标分支或commit代码 * @param opts */ safeCheckout(opts: { branch?: string; commitHash?: string; localBranch?: string; }): Promise; /** * 在仓库目录内获取工程目录 */ getGitDir(): string; /** * 当前分支名 * 例子 (HEAD -> chore/xxx, origin/chore/xxx) * 返回 chore/xxx * git > 2.22 可使用 git branch --show-current 获取 */ getBranchName(): string; /** * 获取分支名 * @deprecated 需要重构的代码 * @param opts */ getBranchNameSafe(opts: { gitDir: string; shortHash: string; }): string; /** * 获取工作分支的全部diff文件列表(忽略删除的文件) */ getBranchDiffFiles(opts: { gitDir?: string; branchName?: string; fromBranch?: string; fileGrep?: string; realPath?: boolean; }): string[]; /** * 获取当前分支起点commit * 依赖日志分析,需要带PullRequest / Merge信息 */ getBranchSourceCommit(): string; /** * 获取最后一次commit详情 */ getLastCommit(opts?: { gitDir?: string; }): any; /** * git@github.com:group/repo.git => http://github.com/group/repo * https://user@token@github.com/group/repo.git => https://github.com/group/repo */ formatGitHttpUrl(remote?: string): string; /** * 查询日常迭代分支上的所有PR */ getPRList(branch?: string): { hash: string; author: string; title: string; }[]; };