MCPcopy Create free account
hub / github.com/cloudflare/computer / logWith

Function logWith

packages/computer/src/git/reads.ts:101–124  ·  view source on GitHub ↗
(opts: LogWithDeps)

Source from the content-addressed store, hash-verified

99}
100
101export async function logWith(opts: LogWithDeps): Promise<CommitView[]> {
102 const dir = opts.dir ?? "/";
103 let entries: Awaited<ReturnType<IsomorphicGitReadsClient["log"]>>;
104 try {
105 entries = await opts.git.log({
106 fs: opts.fs,
107 dir,
108 ref: opts.ref ?? "HEAD",
109 depth: opts.depth,
110 cache: opts.cache,
111 });
112 } catch (cause) {
113 if (isNotARepositoryCause(cause)) throw new NotARepositoryError(dir, { cause });
114 throw new GitError("ELOGFAIL", `git log failed: ${errorMessage(cause)}`, { cause });
115 }
116 return entries.map((e) => ({
117 oid: e.oid,
118 message: e.commit.message,
119 tree: e.commit.tree,
120 parent: e.commit.parent,
121 author: e.commit.author,
122 committer: e.commit.committer,
123 }));
124}
125
126// ---------------------------------------------------------------
127// show

Callers 2

logFunction · 0.85
reads.test.tsFile · 0.85

Calls 3

isNotARepositoryCauseFunction · 0.85
errorMessageFunction · 0.70
logMethod · 0.65

Tested by

no test coverage detected