use gitRepo
This commit is contained in:
parent
a7642b3b6e
commit
549c779a38
7 changed files with 10 additions and 10 deletions
|
@ -90,10 +90,10 @@ makeGitRemote basename location = makeRemote basename location $ \name ->
|
|||
- Returns the name of the remote. -}
|
||||
makeRemote :: String -> String -> (String -> Annex ()) -> Annex String
|
||||
makeRemote basename location a = do
|
||||
r <- fromRepo id
|
||||
if not (any samelocation $ Git.remotes r)
|
||||
g <- gitRepo
|
||||
if not (any samelocation $ Git.remotes g)
|
||||
then do
|
||||
let name = uniqueRemoteName basename 0 r
|
||||
let name = uniqueRemoteName basename 0 g
|
||||
a name
|
||||
return name
|
||||
else return basename
|
||||
|
|
|
@ -84,7 +84,7 @@ reconnectRemotes threadname st dstatus scanremotes rs = void $
|
|||
pushToRemotes :: ThreadName -> UTCTime -> ThreadState -> Maybe FailedPushMap -> [Remote] -> IO Bool
|
||||
pushToRemotes threadname now st mpushmap remotes = do
|
||||
(g, branch, u) <- runThreadState st $ (,,)
|
||||
<$> fromRepo id
|
||||
<$> gitRepo
|
||||
<*> inRepo Git.Branch.current
|
||||
<*> getUUID
|
||||
go True branch g u remotes
|
||||
|
@ -145,7 +145,7 @@ pushToRemotes threadname now st mpushmap remotes = do
|
|||
{- Manually pull from remotes and merge their branches. -}
|
||||
manualPull :: ThreadState -> Maybe Git.Ref -> [Remote] -> IO Bool
|
||||
manualPull st currentbranch remotes = do
|
||||
g <- runThreadState st $ fromRepo id
|
||||
g <- runThreadState st gitRepo
|
||||
forM_ remotes $ \r ->
|
||||
Git.Command.runBool "fetch" [Param $ Remote.name r] g
|
||||
haddiverged <- runThreadState st Annex.Branch.forceUpdate
|
||||
|
|
|
@ -25,7 +25,7 @@ thisThread = "Merger"
|
|||
- pushes. -}
|
||||
mergeThread :: ThreadState -> DaemonStatusHandle -> TransferQueue -> NamedThread
|
||||
mergeThread st dstatus transferqueue = thread $ do
|
||||
g <- runThreadState st $ fromRepo id
|
||||
g <- runThreadState st gitRepo
|
||||
let dir = Git.localGitDir g </> "refs"
|
||||
createDirectoryIfMissing True dir
|
||||
let hook a = Just $ runHandler st dstatus transferqueue a
|
||||
|
|
|
@ -74,7 +74,7 @@ oneDay = 24 * 60 * 60
|
|||
- will block the watcher. -}
|
||||
check :: ThreadState -> DaemonStatusHandle -> TransferQueue -> ChangeChan -> IO Bool
|
||||
check st dstatus transferqueue changechan = do
|
||||
g <- runThreadState st $ fromRepo id
|
||||
g <- runThreadState st gitRepo
|
||||
-- Find old unstaged symlinks, and add them to git.
|
||||
(unstaged, cleanup) <- Git.LsFiles.notInRepo False ["."] g
|
||||
now <- getPOSIXTime
|
||||
|
|
|
@ -24,7 +24,7 @@ thisThread = "TransferPoller"
|
|||
- of each transfer is complete. -}
|
||||
transferPollerThread :: ThreadState -> DaemonStatusHandle -> NamedThread
|
||||
transferPollerThread st dstatus = thread $ do
|
||||
g <- runThreadState st $ fromRepo id
|
||||
g <- runThreadState st gitRepo
|
||||
tn <- newNotificationHandle =<<
|
||||
transferNotifier <$> getDaemonStatus dstatus
|
||||
forever $ do
|
||||
|
|
|
@ -94,7 +94,7 @@ expensiveScan :: ThreadState -> DaemonStatusHandle -> TransferQueue -> [Remote]
|
|||
expensiveScan st dstatus transferqueue rs = unless onlyweb $ do
|
||||
liftIO $ debug thisThread ["starting scan of", show visiblers]
|
||||
void $ alertWhile dstatus (scanAlert visiblers) $ do
|
||||
g <- runThreadState st $ fromRepo id
|
||||
g <- runThreadState st gitRepo
|
||||
(files, cleanup) <- LsFiles.inRepo [] g
|
||||
go files
|
||||
void cleanup
|
||||
|
|
|
@ -24,7 +24,7 @@ thisThread = "TransferWatcher"
|
|||
- and updates the DaemonStatus's map of ongoing transfers. -}
|
||||
transferWatcherThread :: ThreadState -> DaemonStatusHandle -> TransferQueue -> NamedThread
|
||||
transferWatcherThread st dstatus transferqueue = thread $ do
|
||||
g <- runThreadState st $ fromRepo id
|
||||
g <- runThreadState st gitRepo
|
||||
let dir = gitAnnexTransferDir g
|
||||
createDirectoryIfMissing True dir
|
||||
let hook a = Just $ runHandler st dstatus transferqueue a
|
||||
|
|
Loading…
Add table
Reference in a new issue