MCPcopy Index your code
hub / github.com/coderoad/coderoad-vscode / loadCommitHistory

Function loadCommitHistory

src/services/git/index.ts:163–177  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

161}
162
163export async function loadCommitHistory(): Promise<string[]> {
164 try {
165 // returns an list of commit hashes
166 const { stdout, stderr } = await exec({ command: 'git log --pretty=format:"%h"' })
167 if (stderr) {
168 return []
169 }
170 // string match on remote output
171 return stdout.split('\n')
172 } catch (error: any) {
173 // likely no git setup or no commits
174 logger(`Warn: ${error.message}`)
175 return []
176 }
177}
178
179// return the short form of a hash (first 7 characters)
180// using `git rev-parse` seems unnecessarily slower

Callers

nothing calls this directly

Calls 2

execFunction · 0.90
loggerFunction · 0.50

Tested by

no test coverage detected