MCPcopy Index your code
hub / github.com/github/docs / listMatchingRefs

Function listMatchingRefs

script/helpers/git-utils.js:21–35  ·  view source on GitHub ↗
(owner, repo, ref)

Source from the content-addressed store, hash-verified

19
20// https://docs.github.com/rest/reference/git#list-matching-references
21export async function listMatchingRefs(owner, repo, ref) {
22 try {
23 // if the ref is found, this returns an array of objects;
24 // if the ref is not found, this returns an empty array
25 const { data } = await github.git.listMatchingRefs({
26 owner,
27 repo,
28 ref,
29 })
30 return data
31 } catch (err) {
32 console.log('error getting tree')
33 throw err
34 }
35}
36
37// https://docs.github.com/rest/reference/git#get-a-commit
38export async function getTreeSha(owner, repo, commitSha) {

Callers 1

setBranchAsRefFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected