summaryrefslogtreecommitdiff
path: root/Remote/Git.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-03-30 15:15:46 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-03-30 15:15:46 -0400
commit0c73c08c1c0929f0ba53dcfb6d5d32a73a5f28d5 (patch)
treeec87415f92f3b766183108662fcec4bbf2bb665e /Remote/Git.hs
parentfdd455e913964200177530df085f2a7ad7c7f8b2 (diff)
cost bugfixes
Diffstat (limited to 'Remote/Git.hs')
-rw-r--r--Remote/Git.hs9
1 files changed, 7 insertions, 2 deletions
diff --git a/Remote/Git.hs b/Remote/Git.hs
index 286a8c645..c1423bef7 100644
--- a/Remote/Git.hs
+++ b/Remote/Git.hs
@@ -42,8 +42,8 @@ list = do
g <- Annex.gitRepo
return $ Git.remotes g
-gen :: Git.Repo -> UUID -> Cost -> Maybe (M.Map String String) -> Annex (Remote Annex)
-gen r u cst _ = do
+gen :: Git.Repo -> UUID -> Maybe (M.Map String String) -> Annex (Remote Annex)
+gen r u _ = do
{- It's assumed to be cheap to read the config of non-URL remotes,
- so this is done each time git-annex is run. Conversely,
- the config of an URL remote is only read when there is no
@@ -54,6 +54,11 @@ gen r u cst _ = do
(False, "") -> tryGitConfigRead r
_ -> return r
+ let defcst = if not $ Git.repoIsUrl r
+ then cheapRemoteCost
+ else expensiveRemoteCost
+ cst <- remoteCost r' defcst
+
return $ Remote {
uuid = u,
cost = cst,