more windows path fixes

beneathSubTree can be called with both windows-style and git-style paths,
so needs to normalize to windows-style.
This commit is contained in:
Joey Hess 2016-05-04 12:36:50 -04:00
parent 2c2de1a9a1
commit 2cdfe33a4c
Failed to extract signature

View file

@ -256,7 +256,7 @@ inTree :: (GitPath t, GitPath f) => t -> f -> Bool
inTree t f = gitPath t == takeDirectory (gitPath f)
beneathSubTree :: (GitPath t, GitPath f) => t -> f -> Bool
beneathSubTree t f = prefix `isPrefixOf` gitPath f
beneathSubTree t f = prefix `isPrefixOf` normalise (gitPath f)
where
tp = gitPath t
prefix = if null tp then tp else addTrailingPathSeparator tp
prefix = if null tp then tp else addTrailingPathSeparator (normalise tp)