summaryrefslogtreecommitdiff
path: root/Remote/Git.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-10-03 22:24:57 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-10-03 23:29:48 -0400
commit8ef2095fa00408ce6729596a42bc0abdc7778098 (patch)
treed6fc3c9f9519ba2ce617a804ce1c5f33f59a9109 /Remote/Git.hs
parent003a604a6e48a8a0ffd1564e3399b54e8c673e92 (diff)
factor out common imports
no code changes
Diffstat (limited to 'Remote/Git.hs')
-rw-r--r--Remote/Git.hs27
1 files changed, 9 insertions, 18 deletions
diff --git a/Remote/Git.hs b/Remote/Git.hs
index d50899c67..a457c5905 100644
--- a/Remote/Git.hs
+++ b/Remote/Git.hs
@@ -8,26 +8,17 @@
module Remote.Git (remote) where
import Control.Exception.Extensible
-import Control.Monad.State (liftIO)
import qualified Data.Map as M
-import System.Cmd.Utils
-import System.Posix.Files
-import System.IO
-import Types
+import AnnexCommon
+import Utility.CopyFile
+import Utility.RsyncFile
+import Utility.Ssh
import Types.Remote
import qualified Git
import qualified Annex
-import Locations
import UUID
-import Utility
import qualified Content
-import Messages
-import Utility.CopyFile
-import Utility.RsyncFile
-import Utility.Ssh
-import Utility.SafeCommand
-import Utility.Path
import qualified Utility.Url as Url
import Config
import Init
@@ -42,7 +33,7 @@ remote = RemoteType {
list :: Annex [Git.Repo]
list = do
- g <- Annex.gitRepo
+ g <- gitRepo
return $ Git.remotes g
gen :: Git.Repo -> UUID -> Maybe RemoteConfig -> Annex (Remote Annex)
@@ -109,7 +100,7 @@ tryGitConfigRead r
store a = do
r' <- a
- g <- Annex.gitRepo
+ g <- gitRepo
let l = Git.remotes g
let g' = Git.remotesAdd g $ exchange l r'
Annex.changeState $ \s -> s { Annex.repo = g' }
@@ -169,7 +160,7 @@ copyFromRemote r key file
copyToRemote :: Git.Repo -> Key -> Annex Bool
copyToRemote r key
| not $ Git.repoIsUrl r = do
- g <- Annex.gitRepo
+ g <- gitRepo
let keysrc = gitAnnexLocation g key
-- run copy from perspective of remote
liftIO $ onLocal r $ do
@@ -178,7 +169,7 @@ copyToRemote r key
Content.saveState
return ok
| Git.repoIsSsh r = do
- g <- Annex.gitRepo
+ g <- gitRepo
let keysrc = gitAnnexLocation g key
rsyncHelper =<< rsyncParamsRemote r False key keysrc
| otherwise = error "copying to non-ssh repo not supported"
@@ -200,7 +191,7 @@ rsyncOrCopyFile r src dest = do
ss <- liftIO $ getFileStatus $ parentDir src
ds <- liftIO $ getFileStatus $ parentDir dest
if deviceID ss == deviceID ds
- then liftIO $ copyFile src dest
+ then liftIO $ copyFileExternal src dest
else do
params <- rsyncParams r
rsyncHelper $ params ++ [Param src, Param dest]