reorg
This commit is contained in:
parent
0ddcaae9c1
commit
cdd27b8920
11 changed files with 54 additions and 43 deletions
18
Backend.hs
18
Backend.hs
|
@ -9,7 +9,6 @@ module Backend (
|
|||
list,
|
||||
orderedList,
|
||||
genKey,
|
||||
lookupFile,
|
||||
getBackend,
|
||||
chooseBackend,
|
||||
lookupBackendName,
|
||||
|
@ -20,8 +19,6 @@ module Backend (
|
|||
import Common.Annex
|
||||
import qualified Annex
|
||||
import Annex.CheckAttr
|
||||
import Annex.CatFile
|
||||
import Annex.Link
|
||||
import Types.Key
|
||||
import Types.KeySource
|
||||
import qualified Types.Backend as B
|
||||
|
@ -76,21 +73,6 @@ genKey' (b:bs) source = do
|
|||
| c == '\n' = '_'
|
||||
| otherwise = c
|
||||
|
||||
{- Looks up the key corresponding to an annexed file,
|
||||
- by examining what the file links to.
|
||||
-
|
||||
- An unlocked file will not have a link on disk, so fall back to
|
||||
- looking for a pointer to a key in git.
|
||||
-}
|
||||
lookupFile :: FilePath -> Annex (Maybe Key)
|
||||
lookupFile file = do
|
||||
mkey <- isAnnexLink file
|
||||
case mkey of
|
||||
Just key -> makeret key
|
||||
Nothing -> maybe (return Nothing) makeret =<< catKeyFile file
|
||||
where
|
||||
makeret = return . Just
|
||||
|
||||
getBackend :: FilePath -> Key -> Annex (Maybe Backend)
|
||||
getBackend file k = let bname = keyBackendName k in
|
||||
case maybeLookupBackendName bname of
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue