Homec4science

Allow Filesystem::walkToRoot() to operate on fictional paths

Authored by epriestley <git@epriestley.com> on Oct 4 2015, 17:12.

Description

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

Details

Committed
epriestley <git@epriestley.com>Oct 4 2015, 17:12
Pushed
aubortMar 17 2017, 12:03
Parents
rPHU21ee3ad4ba5f: Fix unit test errors in libphutil
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHU8870e8fe9df8: Allow Filesystem::walkToRoot() to operate on fictional paths (authored by epriestley <git@epriestley.com>).Oct 4 2015, 17:12