Skip to content

Fix Load-Order Bug - #44

Merged
faceleg merged 3 commits into
nodegit:masterfrom
fatlotus:master
Feb 28, 2013
Merged

Fix Load-Order Bug#44
faceleg merged 3 commits into
nodegit:masterfrom
fatlotus:master

Conversation

@fatlotus

Copy link
Copy Markdown
Contributor

Hey guys-

To be honest, I'm not sure if this is a bug or not. I've found it inconvenient behavior in my own use, so I've changed it in my local fork. Currently, when a nested directory is iterated over, the 'end' event is only called when all the root entries have loaded, meaning that it is impossible to know when all sub-entries are complete.

This patch requires that all sub-queries load before the root directory is to load. (There's a line in here, "tree.error" that I'm not sure I understand — right now the "end" event will not fire if this the case.)

This code fixes a bug whereby some tree elements will not yet
have loaded when the 'end' event is signalled.
@faceleg

faceleg commented Feb 27, 2013

Copy link
Copy Markdown
Collaborator

HI @fatlotus, it seems logical that the end event should fire only when the full tree has been scanned. I've added a unit test that is currently failing, thus proving your observation. If you'd like to update your fork & run the tests to ensure your code causes it to pass, we can look at merging your PR.

@faceleg
faceleg merged commit 3e0f15d into nodegit:master Feb 28, 2013
@faceleg

faceleg commented Feb 28, 2013

Copy link
Copy Markdown
Collaborator

Couldn't help it, I wrote the tests. Thanks for your contribution!

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