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

Function getSortedRefs

packages/backend/src/git.ts:308–327  ·  view source on GitHub ↗
({
    path,
    sort,
    refNamespace,
}: {
    path: string,
    sort: string,
    refNamespace: 'refs/heads' | 'refs/tags',
})

Source from the content-addressed store, hash-verified

306 .filter(Boolean);
307
308const getSortedRefs = async ({
309 path,
310 sort,
311 refNamespace,
312}: {
313 path: string,
314 sort: string,
315 refNamespace: 'refs/heads' | 'refs/tags',
316}) => {
317 const git = createGitClientForPath(path);
318
319 return parseRefNames(
320 await git.raw([
321 "for-each-ref",
322 `--sort=${sort}`,
323 "--format=%(refname:short)",
324 refNamespace,
325 ]),
326 );
327};
328
329export const getBranches = async (path: string) => {
330 return getSortedRefs({

Callers 2

getBranchesFunction · 0.85
getTagsFunction · 0.85

Calls 2

createGitClientForPathFunction · 0.85
parseRefNamesFunction · 0.85

Tested by

no test coverage detected