How to fetch a sub-tree with the "trees" API? #109485
Select Topic AreaQuestion BodyThe doc of the Get a Tree API says:
How can I fetch a sub-tree? It seems like it is not documented. |
Answered by
zapster
Feb 26, 2024
Replies: 1 comment
|
To answer my own question, the {
"tree": [
{
"path": "subdir",
"mode": "040000",
"type": "tree",
"sha": "f484d249c660418515fb01c2b9662073663c242e",
"url": "https://api.github.com/repos/octocat/Hello-World/git/tree/f484d249c660418515fb01c2b9662073663c242e"
},The corresponding |
0 replies
Answer selected by
zapster
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To answer my own question, the
treeproperty in the response contains entries oftypetreefor subdirectories:{ "tree": [ { "path": "subdir", "mode": "040000", "type": "tree", "sha": "f484d249c660418515fb01c2b9662073663c242e", "url": "https://api.github.com/repos/octocat/Hello-World/git/tree/f484d249c660418515fb01c2b9662073663c242e" },The corresponding
urlpoints to the sub-tree.