({
path,
sort,
refNamespace,
}: {
path: string,
sort: string,
refNamespace: 'refs/heads' | 'refs/tags',
})
| 306 | .filter(Boolean); |
| 307 | |
| 308 | const 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 | |
| 329 | export const getBranches = async (path: string) => { |
| 330 | return getSortedRefs({ |
no test coverage detected