Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix util.relative for the case where the path is above the root.
Currently, util.relative simply checks if the root is a prefix of the path. This works fine when the path is below the root, but won't work if the path is above the root. To fix this, we should remove components from the root one by one, until either we find a prefix that fits, or we run out of components to match.
- Loading branch information
Showing
3 changed files
with
50 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters