convert parentDir to be based on takeDirectory, but fixed for trailing /

This commit is contained in:
Joey Hess 2015-01-09 14:26:52 -04:00
parent 3bab5dfb1d
commit f4de021a54
4 changed files with 22 additions and 24 deletions

View file

@ -45,9 +45,9 @@ fromCwd = getCurrentDirectory >>= seekUp
seekUp dir = do
r <- checkForRepo dir
case r of
Nothing -> case parentDir dir of
"" -> return Nothing
d -> seekUp d
Nothing -> case upFrom dir of
Nothing -> return Nothing
Just d -> seekUp d
Just loc -> Just <$> newFrom loc
{- Local Repo constructor, accepts a relative or absolute path. -}