diff options
author | Joey Hess <joey@kitenet.net> | 2011-11-19 15:27:10 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-11-19 15:27:10 -0400 |
commit | 32d9813b1dc50a3300f24f3ddbf534c6cc529d6e (patch) | |
tree | a1ae7739eaceb1e79a2a4b6e69aa0a56b197f5f2 /Command.hs | |
parent | 3905053a18011eb92f00754cb1f7e5331370e2ce (diff) |
tweak
Diffstat (limited to 'Command.hs')
-rw-r--r-- | Command.hs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Command.hs b/Command.hs index b66217192..4d5bbeb36 100644 --- a/Command.hs +++ b/Command.hs @@ -92,11 +92,10 @@ isBareRepo = fromRepo Git.repoIsLocalBare - copies of the key is > or < than the numcopies setting, before running - the action. -} autoCopies :: Key -> (Int -> Int -> Bool) -> Maybe Int -> CommandStart -> CommandStart -autoCopies key vs numcopiesattr a = do - auto <- Annex.getState Annex.auto - if auto - then do +autoCopies key vs numcopiesattr a = Annex.getState Annex.auto >>= auto + where + auto False = a + auto True = do needed <- getNumCopies numcopiesattr (_, have) <- trustPartition UnTrusted =<< keyLocations key if length have `vs` needed then a else stop - else a |