(opts: LogWithDeps)
| 99 | } |
| 100 | |
| 101 | export 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 |
no test coverage detected