reorg
This commit is contained in:
parent
0ddcaae9c1
commit
cdd27b8920
11 changed files with 54 additions and 43 deletions
11
Command.hs
11
Command.hs
|
@ -18,12 +18,13 @@ module Command (
|
|||
stopUnless,
|
||||
whenAnnexed,
|
||||
ifAnnexed,
|
||||
lookupFile,
|
||||
isBareRepo,
|
||||
module ReExported
|
||||
) where
|
||||
|
||||
import Common.Annex
|
||||
import qualified Backend
|
||||
import Annex.WorkTree
|
||||
import qualified Git
|
||||
import Types.Command as ReExported
|
||||
import Types.Option as ReExported
|
||||
|
@ -100,13 +101,5 @@ stop = return Nothing
|
|||
stopUnless :: Annex Bool -> Annex (Maybe a) -> Annex (Maybe a)
|
||||
stopUnless c a = ifM c ( a , stop )
|
||||
|
||||
{- Modifies an action to only act on files that are already annexed,
|
||||
- and passes the key on to it. -}
|
||||
whenAnnexed :: (FilePath -> Key -> Annex (Maybe a)) -> FilePath -> Annex (Maybe a)
|
||||
whenAnnexed a file = ifAnnexed file (a file) (return Nothing)
|
||||
|
||||
ifAnnexed :: FilePath -> (Key -> Annex a) -> Annex a -> Annex a
|
||||
ifAnnexed file yes no = maybe no yes =<< Backend.lookupFile file
|
||||
|
||||
isBareRepo :: Annex Bool
|
||||
isBareRepo = fromRepo Git.repoIsLocalBare
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue