MCPcopy Create free account
hub / github.com/Tencent/teamai-cli / getFileContentAtRev

Function getFileContentAtRev

src/utils/git.ts:830–842  ·  view source on GitHub ↗
(
  repoPath: string,
  rev: string,
  filePath: string,
)

Source from the content-addressed store, hash-verified

828 * Returns null if the file doesn't exist at that revision or if the rev is invalid.
829 */
830export 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
844export async function getRepoStatus(localPath: string): Promise<{ ahead: number; behind: number; modified: string[] }> {
845 const git = createGit(localPath);

Callers 5

pushFunction · 0.85
pushCoreFunction · 0.85
reportUsageToTeamFunction · 0.85
syncRulesToLocalFunction · 0.85
syncSkillsToLocalFunction · 0.85

Calls 1

createGitFunction · 0.85

Tested by

no test coverage detected