1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 01:08:50 +02:00

Fix failing unit test testParentEdgeCases under Windows

Summary: Noticed that this one was failing under Windows for the test cases where the root path (`/`) was supposed to be returned. Was returned Windows-style, made it return UNIX-style. All others work fine (return slashes as-is).

Test Plan:
`arc unit --everything` before and after this patch on Windows.

Will try out Ubuntu in near future.

Reviewers: epriestley, vrana

Reviewed By: vrana

CC: aran, Korvin, vrana

Differential Revision: https://secure.phabricator.com/D5497
This commit is contained in:
Anh Nhan Nguyen 2013-04-02 09:01:33 -07:00 committed by epriestley
parent 86312d6986
commit b0d408c5d3

View file

@ -63,7 +63,11 @@ final class DiffusionPathIDQuery {
*/
public static function getParentPath($path) {
$path = self::normalizePath($path);
return dirname($path);
$path = dirname($path);
if (phutil_is_windows() && $path == '\\') {
$path = '/';
}
return $path;
}