MCPcopy Create free account
hub / github.com/github/docs / getTreeSha

Function getTreeSha

script/helpers/git-utils.js:38–50  ·  view source on GitHub ↗
(owner, repo, commitSha)

Source from the content-addressed store, hash-verified

36
37// https://docs.github.com/rest/reference/git#get-a-commit
38export async function getTreeSha(owner, repo, commitSha) {
39 try {
40 const { data } = await github.git.getCommit({
41 owner,
42 repo,
43 commit_sha: commitSha,
44 })
45 return data.tree.sha
46 } catch (err) {
47 console.log('error getting tree')
48 throw err
49 }
50}
51
52// https://docs.github.com/rest/reference/git#get-a-tree
53export async function getTree(owner, repo, ref) {

Callers 1

getTreeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected