factor out file list stuff from GitRepo
GitRepo is getting too large an interface; these all fit nicely into a submodule.
This commit is contained in:
parent
af45d42224
commit
06a1f5f742
6 changed files with 82 additions and 66 deletions
|
@ -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 }
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue