summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-06-29 11:55:16 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-06-29 11:55:16 -0400
commit06a1f5f74286795708b219de8fb080077ff134a7 (patch)
treecfdb751f3ae77c307e8da1268ff55b9d887212e4 /Command
parentaf45d422248846869babdbc3eae2765d94ea9f20 (diff)
factor out file list stuff from GitRepo
GitRepo is getting too large an interface; these all fit nicely into a submodule.
Diffstat (limited to 'Command')
-rw-r--r--Command/Unannex.hs3
-rw-r--r--Command/Unused.hs3
2 files changed, 4 insertions, 2 deletions
diff --git a/Command/Unannex.hs b/Command/Unannex.hs
index 0a5381d56..0de98b1d3 100644
--- a/Command/Unannex.hs
+++ b/Command/Unannex.hs
@@ -20,6 +20,7 @@ import LocationLog
import Types
import Content
import qualified GitRepo as Git
+import qualified GitRepo.LsFiles as LsFiles
import Messages
command :: [Command]
@@ -37,7 +38,7 @@ start file = isAnnexed file $ \(key, backend) -> do
force <- Annex.getState Annex.force
unless force $ do
g <- Annex.gitRepo
- staged <- liftIO $ Git.stagedFiles g [Git.workTree g]
+ staged <- liftIO $ LsFiles.staged g [Git.workTree g]
unless (null staged) $
error "This command cannot be run when there are already files staged for commit."
Annex.changeState $ \s -> s { Annex.force = True }
diff --git a/Command/Unused.hs b/Command/Unused.hs
index 5744f84fd..c0a347179 100644
--- a/Command/Unused.hs
+++ b/Command/Unused.hs
@@ -23,6 +23,7 @@ import Utility
import LocationLog
import qualified Annex
import qualified GitRepo as Git
+import qualified GitRepo.LsFiles as LsFiles
import qualified Backend
import qualified Remote
@@ -175,7 +176,7 @@ exclude smaller larger = S.toList $ remove larger $ S.fromList smaller
getKeysReferenced :: Annex [Key]
getKeysReferenced = do
g <- Annex.gitRepo
- files <- liftIO $ Git.inRepo g [Git.workTree g]
+ files <- liftIO $ LsFiles.inRepo g [Git.workTree g]
keypairs <- mapM Backend.lookupFile files
return $ map fst $ catMaybes keypairs