diff options
Diffstat (limited to 'Content.hs')
-rw-r--r-- | Content.hs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Content.hs b/Content.hs index ade936da3..9040383be 100644 --- a/Content.hs +++ b/Content.hs @@ -57,11 +57,11 @@ calcGitLink :: FilePath -> Key -> Annex FilePath calcGitLink file key = do g <- Annex.gitRepo cwd <- liftIO $ getCurrentDirectory - let absfile = case absNormPath cwd file of - Just f -> f - Nothing -> error $ "unable to normalize " ++ file + let absfile = maybe whoops id $ absNormPath cwd file return $ relPathDirToFile (parentDir absfile) (Git.workTree g) </> ".git" </> annexLocation key + where + whoops = error $ "unable to normalize " ++ file {- Updates the LocationLog when a key's presence changes in the current - repository. @@ -148,9 +148,7 @@ checkDiskSpace' :: Integer -> Key -> Annex () checkDiskSpace' adjustment key = do g <- Annex.gitRepo r <- getConfig g "diskreserve" "" - let reserve = case readSize dataUnits r of - Nothing -> megabyte - Just v -> v + let reserve = maybe megabyte id $ readSize dataUnits r stats <- liftIO $ getFileSystemStats (gitAnnexDir g) case (stats, keySize key) of (Nothing, _) -> return () |