Skip to content

Allow blob get of deep tree data - #8

Merged
alex-e-leon merged 2 commits into
alex-e-leon:masterfrom
lyuzashi:recursive-tree
Jan 24, 2018
Merged

alex-e-leon merged 2 commits into
alex-e-leon:masterfrom
lyuzashi:recursive-tree

Conversation

@lyuzashi

Copy link
Copy Markdown
Contributor

Hi @alex-e-leon! I had a chance to try out the getTree solution on a real-world repo and encountered a little issue.

Turns out by default getTree only returns a shallow tree, and the large file I was attempting to include in the diff is buried a few directories deep.

Easy fix (so long as this doesn't run into the "maximum limit" and get truncated) using the recursive option.

@alex-e-leon

Copy link
Copy Markdown
Owner

@lyuzashi Ah yeah nice - I was really struggling with the github docs on getTree, they're pretty sparse, and I couldn't figure out what the recursive option actually did, but it looks like without it it doesn't actually traverse sub-dirs.

What's frustrating is

If truncated is true, the number of items in the tree array exceeded our maximum limit
But they don't actually tell us what the maximum limit is?

Would be worth adding a comment in the code about that maximum limit and that we don't handle it if you don't mind. Otherwise LGTM!

@alex-e-leon

Copy link
Copy Markdown
Owner

PS - I only skimmed your comment when I wrote mine - looks like you already knew about the truncate stuff haha.

LMK if you don't mind adding that comment

@alex-e-leon
alex-e-leon merged commit 02b6622 into alex-e-leon:master Jan 24, 2018
@alex-e-leon

Copy link
Copy Markdown
Owner

@lyuzashi I decided to just add the comment and publish 👍
published in v1.3.2

Thanks for all the PR's!

@lyuzashi

Copy link
Copy Markdown
Contributor Author

Thanks @alex-e-leon! I was starting to look at a custom error for the case when truncated is true and the specific path is not found but that’s probably overkill. Thanks for releasing so quick, this will keep me out of trouble :D

@alex-e-leon

Copy link
Copy Markdown
Owner

yeah - I figure we can write that code if when someone who uses this runs into the problem - I dont even know how big your tree needs to be before that's an issue - no point writing code for something that may never come up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants