diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-11-30 16:08:30 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-11-30 16:14:36 -0400 |
commit | 75fc70d0ff8cf1271f6c1133efb1baca9b8b6679 (patch) | |
tree | 6b967740fba695a0895f287a9ca366b233d3dc21 /Annex/Content.hs | |
parent | 6f5108c4d965383436ec88e92f8cb26b80fe8644 (diff) |
honor annex.diskreserve when running youtube-dl
This commit was sponsored by André Pereira on Patreon.
Diffstat (limited to 'Annex/Content.hs')
-rw-r--r-- | Annex/Content.hs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Annex/Content.hs b/Annex/Content.hs index 4db5fda38..986f673f6 100644 --- a/Annex/Content.hs +++ b/Annex/Content.hs @@ -21,6 +21,7 @@ module Annex.Content ( prepTmp, withTmp, checkDiskSpace, + needMoreDiskSpace, moveAnnex, populatePointerFile, linkToAnnex, @@ -431,16 +432,17 @@ checkDiskSpace' need destdir key alreadythere samefilesystem = ifM (Annex.getSta let delta = need + reserve - have - alreadythere + inprogress let ok = delta <= 0 unless ok $ - needmorespace delta + warning $ needMoreDiskSpace delta return ok _ -> return True ) where dir = maybe (fromRepo gitAnnexDir) return destdir - needmorespace n = - warning $ "not enough free space, need " ++ - roughSize storageUnits True n ++ - " more" ++ forcemsg + +needMoreDiskSpace :: Integer -> String +needMoreDiskSpace n = "not enough free space, need " ++ + roughSize storageUnits True n ++ " more" ++ forcemsg + where forcemsg = " (use --force to override this check or adjust annex.diskreserve)" {- Moves a key's content into .git/annex/objects/ |