summaryrefslogtreecommitdiff
path: root/Annex
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2018-01-09 15:36:56 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2018-01-09 16:22:07 -0400
commitaff377f1fd40d1d5dbfc44e9a3ca37e646c1dcd4 (patch)
treeca6311b6565f217b1b037c7096d82c791cf010b9 /Annex
parent008fe331573e259960c268e4bd30eb0c851dafb7 (diff)
Improve startup time for commands that do not operate on remotes
And for tab completion, by not unnessessarily statting paths to remotes, which used to cause eg, spin-up of removable drives. Got rid of the remotes member of Git.Repo. This was a bit painful. Remote.Git modifies the list of remotes as it reads their configs, so still need a persistent list of remotes. So, put it in as Annex.gitremotes. It's only populated by getGitRemotes, so commands like examinekey that don't care about remotes won't do so. This commit was sponsored by Jake Vosloo on Patreon.
Diffstat (limited to 'Annex')
-rw-r--r--Annex/Branch.hs1
-rw-r--r--Annex/Content/Direct.hs1
-rw-r--r--Annex/Fixup.hs12
3 files changed, 4 insertions, 10 deletions
diff --git a/Annex/Branch.hs b/Annex/Branch.hs
index 2c7683e9e..c8f2f4c2f 100644
--- a/Annex/Branch.hs
+++ b/Annex/Branch.hs
@@ -60,7 +60,6 @@ import Logs.Transitions
import Logs.File
import Logs.Trust.Pure
import Logs.Difference.Pure
-import Annex.ReplaceFile
import qualified Annex.Queue
import Annex.Branch.Transitions
import qualified Annex
diff --git a/Annex/Content/Direct.hs b/Annex/Content/Direct.hs
index 98323b2b8..46fd327cc 100644
--- a/Annex/Content/Direct.hs
+++ b/Annex/Content/Direct.hs
@@ -32,7 +32,6 @@ module Annex.Content.Direct (
import Annex.Common
import Annex.Perms
import qualified Git
-import Utility.Tmp
import Logs.Location
import Logs.File
import Utility.InodeCache
diff --git a/Annex/Fixup.hs b/Annex/Fixup.hs
index 4b5149d0a..077eccf57 100644
--- a/Annex/Fixup.hs
+++ b/Annex/Fixup.hs
@@ -10,7 +10,6 @@ module Annex.Fixup where
import Git.Types
import Git.Config
import Types.GitConfig
-import qualified Git.Construct as Construct
import qualified Git.BuildVersion
import Utility.Path
import Utility.SafeCommand
@@ -30,7 +29,7 @@ fixupRepo r c = do
let r' = disableWildcardExpansion r
r'' <- fixupSubmodule r' c
if annexDirect c
- then fixupDirect r''
+ then return (fixupDirect r'')
else return r''
{- Disable git's built-in wildcard expansion, which is not wanted
@@ -44,19 +43,16 @@ disableWildcardExpansion r
{- Direct mode repos have core.bare=true, but are not really bare.
- Fix up the Repo to be a non-bare repo, and arrange for git commands
- run by git-annex to be passed parameters that override this setting. -}
-fixupDirect :: Repo -> IO Repo
+fixupDirect :: Repo -> Repo
fixupDirect r@(Repo { location = l@(Local { gitdir = d, worktree = Nothing }) }) = do
- let r' = r
+ r
{ location = l { worktree = Just (parentDir d) }
, gitGlobalOpts = gitGlobalOpts r ++
[ Param "-c"
, Param $ coreBare ++ "=" ++ boolConfig False
]
}
- -- Recalc now that the worktree is correct.
- rs' <- Construct.fromRemotes r'
- return $ r' { remotes = rs' }
-fixupDirect r = return r
+fixupDirect r = r
{- Submodules have their gitdir containing ".git/modules/", and
- have core.worktree set, and also have a .git file in the top