summaryrefslogtreecommitdiff
path: root/Locations.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-12-15 16:58:58 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-12-15 16:58:58 -0400
commit0f9859ae51324ceb21471a09b423715d9fec7f23 (patch)
tree8b0ab7b4c42db0dc34139e7b90805fb814bace13 /Locations.hs
parentfbc3d32f7dca870bb68f16dcec0b601840313eb1 (diff)
avoid partial function
Diffstat (limited to 'Locations.hs')
-rw-r--r--Locations.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/Locations.hs b/Locations.hs
index 85fcb9888..73a2473b5 100644
--- a/Locations.hs
+++ b/Locations.hs
@@ -90,7 +90,8 @@ gitAnnexLocation key r
return $ inrepo ".git" </> annexLocation key hashDirMixed
where
inrepo d = Git.workTree r </> d
- check locs = fromMaybe (head locs) <$> firstM doesFileExist locs
+ check locs@(l:_) = fromMaybe l <$> firstM doesFileExist locs
+ check [] = error "internal"
{- The annex directory of a repository. -}
gitAnnexDir :: Git.Repo -> FilePath