diff options
author | Joey Hess <joey@kitenet.net> | 2011-12-15 16:58:58 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-12-15 16:58:58 -0400 |
commit | 0f9859ae51324ceb21471a09b423715d9fec7f23 (patch) | |
tree | 8b0ab7b4c42db0dc34139e7b90805fb814bace13 /Locations.hs | |
parent | fbc3d32f7dca870bb68f16dcec0b601840313eb1 (diff) |
avoid partial function
Diffstat (limited to 'Locations.hs')
-rw-r--r-- | Locations.hs | 3 |
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 |