summaryrefslogtreecommitdiff
path: root/Command.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-12-15 15:34:28 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-12-15 15:34:28 -0400
commit59654d08a2335bf716f38b76095121c6e4c62535 (patch)
treef4d450caa09cfc4e373ee946b2cef956f9429757 /Command.hs
parent271fe1ce457447b0aee8d825b9186a0b579b56d0 (diff)
reorg
Diffstat (limited to 'Command.hs')
-rw-r--r--Command.hs11
1 files changed, 2 insertions, 9 deletions
diff --git a/Command.hs b/Command.hs
index bee63bb74..387f7b8b5 100644
--- a/Command.hs
+++ b/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