summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-03-21 23:41:01 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-03-22 17:32:47 -0400
commit4eb51126819fe01a003688267f481c6d8014ef47 (patch)
tree40f88312d53da654b65a7ed25617e5bdbd6be03c /Command
parent52b90e5d4c2a22415d48a8e572eab328dfcc4407 (diff)
rationalize getConfig
getConfig got a remote-specific config, and this confusing name caused it to be used a couple of places that only were interested in global configs. Rename to getRemoteConfig and make getConfig only get global configs. There are no behavior changes here, but remote.<name>.annex-web-options never actually worked (and per-remote web options is a very unlikely to be useful case so I didn't make it work), so fix the documentation for it.
Diffstat (limited to 'Command')
-rw-r--r--Command/Status.hs13
1 files changed, 6 insertions, 7 deletions
diff --git a/Command/Status.hs b/Command/Status.hs
index 000374871..aaf848905 100644
--- a/Command/Status.hs
+++ b/Command/Status.hs
@@ -172,14 +172,13 @@ bloom_info = stat "bloom filter size" $ json id $ do
return $ size ++ note
disk_size :: Stat
-disk_size = stat "available local disk space" $ json id $ lift go
+disk_size = stat "available local disk space" $ json id $ lift $
+ if Build.SysConfig.statfs_sanity_checked == Just True
+ then calcfree
+ <$> getDiskReserve False
+ <*> inRepo (getFileSystemStats . gitAnnexDir)
+ else return unknown
where
- go
- | Build.SysConfig.statfs_sanity_checked == Just True =
- calcfree
- <$> getDiskReserve False
- <*> inRepo (getFileSystemStats . gitAnnexDir)
- | otherwise = return unknown
calcfree reserve (Just (FileSystemStats { fsStatBytesAvailable = have })) =
roughSize storageUnits True $ nonneg $ have - reserve
calcfree _ _ = unknown