From 0f9859ae51324ceb21471a09b423715d9fec7f23 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 15 Dec 2011 16:58:58 -0400 Subject: [PATCH] avoid partial function --- Locations.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Locations.hs b/Locations.hs index 85fcb98887..73a2473b56 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