Fix Load-Order Bug #44

Merged
merged 3 commits into from Feb 28, 2013

Projects

None yet

2 participants

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.)

fatlotus added some commits Oct 25, 2012
@fatlotus fatlotus Fix Loading Issue in lib/tree.js
This code fixes a bug whereby some tree elements will not yet
have loaded when the 'end' event is signalled.
059db8a
@fatlotus fatlotus Fix Loading Issue in lib/tree.js [Take Two]
... drrr.
1d5e8c3
@fatlotus fatlotus Fix file path order bug. 3e0f15d
Contributor
faceleg commented Feb 27, 2013

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
Contributor
faceleg commented Feb 28, 2013

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