Allow Filesystem::walkToRoot() to operate on fictional paths
Summary:
This is part of fixing a unit test in arc, but generally seems like a reasonable/desirable behavior.
If you have a path like /x/y/z, where the path is fictional and none of the components actually exist:
- Prior to D13202, we'd walk "/x/y/z" -> "/x/y/" -> "/x" -> "/".
- After D13202, the isDescendant() check rejects this and we don't walk anywhere. We also never hit "/".
- After this diff, walk it again.
The old behavior seems reasonable to me.
Test Plan: Added a unit test, ran unit tests. See next revision (test in arc) for additional context.
Reviewers: joshuaspence, chad
Reviewed By: chad
Differential Revision: https://secure.phabricator.com/D14231