( repoPath: string, rev: string, filePath: string, )
| 828 | * Returns null if the file doesn't exist at that revision or if the rev is invalid. |
| 829 | */ |
| 830 | export async function getFileContentAtRev( |
| 831 | repoPath: string, |
| 832 | rev: string, |
| 833 | filePath: string, |
| 834 | ): Promise<Buffer | null> { |
| 835 | const git = createGit(repoPath); |
| 836 | try { |
| 837 | const result = await git.show([`${rev}:${filePath}`]); |
| 838 | return Buffer.from(result); |
| 839 | } catch { |
| 840 | return null; |
| 841 | } |
| 842 | } |
| 843 | |
| 844 | export async function getRepoStatus(localPath: string): Promise<{ ahead: number; behind: number; modified: string[] }> { |
| 845 | const git = createGit(localPath); |
no test coverage detected