summaryrefslogtreecommitdiff
path: root/Annex
diff options
context:
space:
mode:
Diffstat (limited to 'Annex')
-rw-r--r--Annex/Content.hs13
1 files changed, 12 insertions, 1 deletions
diff --git a/Annex/Content.hs b/Annex/Content.hs
index 1713b5e12..ba67a2f15 100644
--- a/Annex/Content.hs
+++ b/Annex/Content.hs
@@ -177,6 +177,7 @@ checkDiskSpace' adjustment key = do
r <- getConfig g "diskreserve" ""
let reserve = fromMaybe megabyte $ readSize dataUnits r
stats <- liftIO $ getFileSystemStats (gitAnnexDir g)
+ sanitycheck r stats
case (stats, keySize key) of
(Nothing, _) -> return ()
(_, Nothing) -> return ()
@@ -189,7 +190,17 @@ checkDiskSpace' adjustment key = do
needmorespace n = unlessM (Annex.getState Annex.force) $
error $ "not enough free space, need " ++
roughSize storageUnits True n ++
- " more (use --force to override this check or adjust annex.diskreserve)"
+ " more" ++ forcemsg
+ forcemsg = " (use --force to override this check or adjust annex.diskreserve)"
+ sanitycheck r stats
+ | not (null r) && isNothing stats = do
+ unlessM (Annex.getState Annex.force) $
+ error $ "You have configured a diskreserve of "
+ ++ r ++
+ " but disk space checking is not working"
+ ++ forcemsg
+ return ()
+ | otherwise = return ()
{- Moves a file into .git/annex/objects/
-