diff options
author | Joey Hess <joey@kitenet.net> | 2011-06-29 11:55:16 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-06-29 11:55:16 -0400 |
commit | 06a1f5f74286795708b219de8fb080077ff134a7 (patch) | |
tree | cfdb751f3ae77c307e8da1268ff55b9d887212e4 /Command.hs | |
parent | af45d422248846869babdbc3eae2765d94ea9f20 (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.hs')
-rw-r--r-- | Command.hs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/Command.hs b/Command.hs index a8cc6a132..45a4cc70f 100644 --- a/Command.hs +++ b/Command.hs @@ -22,6 +22,7 @@ import qualified Backend import Messages import qualified Annex import qualified GitRepo as Git +import qualified GitRepo.LsFiles as LsFiles import Utility import Types.Key @@ -118,17 +119,17 @@ notBareRepo a = do withFilesInGit :: CommandSeekStrings withFilesInGit a params = do repo <- Annex.gitRepo - files <- liftIO $ runPreserveOrder (Git.inRepo repo) params + files <- liftIO $ runPreserveOrder (LsFiles.inRepo repo) params liftM (map a) $ filterFiles files withAttrFilesInGit :: String -> CommandSeekAttrFiles withAttrFilesInGit attr a params = do repo <- Annex.gitRepo - files <- liftIO $ runPreserveOrder (Git.inRepo repo) params + files <- liftIO $ runPreserveOrder (LsFiles.inRepo repo) params liftM (map a) $ liftIO $ Git.checkAttr repo attr files withBackendFilesInGit :: CommandSeekBackendFiles withBackendFilesInGit a params = do repo <- Annex.gitRepo - files <- liftIO $ runPreserveOrder (Git.inRepo repo) params + files <- liftIO $ runPreserveOrder (LsFiles.inRepo repo) params files' <- filterFiles files backendPairs a files' withFilesMissing :: CommandSeekStrings @@ -143,7 +144,7 @@ withFilesNotInGit :: CommandSeekBackendFiles withFilesNotInGit a params = do repo <- Annex.gitRepo force <- Annex.getState Annex.force - newfiles <- liftIO $ runPreserveOrder (Git.notInRepo repo force) params + newfiles <- liftIO $ runPreserveOrder (LsFiles.notInRepo repo force) params newfiles' <- filterFiles newfiles backendPairs a newfiles' withWords :: CommandSeekWords @@ -153,12 +154,12 @@ withStrings a params = return $ map a params withFilesToBeCommitted :: CommandSeekStrings withFilesToBeCommitted a params = do repo <- Annex.gitRepo - tocommit <- liftIO $ runPreserveOrder (Git.stagedFilesNotDeleted repo) params + tocommit <- liftIO $ runPreserveOrder (LsFiles.stagedNotDeleted repo) params liftM (map a) $ filterFiles tocommit withFilesUnlocked :: CommandSeekBackendFiles -withFilesUnlocked = withFilesUnlocked' Git.typeChangedFiles +withFilesUnlocked = withFilesUnlocked' LsFiles.typeChanged withFilesUnlockedToBeCommitted :: CommandSeekBackendFiles -withFilesUnlockedToBeCommitted = withFilesUnlocked' Git.typeChangedStagedFiles +withFilesUnlockedToBeCommitted = withFilesUnlocked' LsFiles.typeChangedStaged withFilesUnlocked' :: (Git.Repo -> [FilePath] -> IO [FilePath]) -> CommandSeekBackendFiles withFilesUnlocked' typechanged a params = do -- unlocked files have changed type from a symlink to a regular file |