MCPcopy Index your code
hub / github.com/sourcebot-dev/sourcebot / commitFile

Function commitFile

packages/backend/src/git.test.ts:35–54  ·  view source on GitHub ↗
({
    repoPath,
    fileName,
    content,
    message,
    timestamp,
}: {
    repoPath: string;
    fileName: string;
    content: string;
    message: string;
    timestamp: string;
})

Source from the content-addressed store, hash-verified

33};
34
35const commitFile = async ({
36 repoPath,
37 fileName,
38 content,
39 message,
40 timestamp,
41}: {
42 repoPath: string;
43 fileName: string;
44 content: string;
45 message: string;
46 timestamp: string;
47}) => {
48 await writeFile(join(repoPath, fileName), content);
49 runGit(repoPath, ["add", fileName]);
50 runGit(repoPath, ["commit", "-m", message], {
51 GIT_AUTHOR_DATE: timestamp,
52 GIT_COMMITTER_DATE: timestamp,
53 });
54};
55
56describe("git ref ordering", () => {
57 const repoPaths: string[] = [];

Callers 1

git.test.tsFile · 0.85

Calls 1

runGitFunction · 0.85

Tested by

no test coverage detected