diff options
author | Joey Hess <joey@kitenet.net> | 2013-02-15 16:02:35 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-02-15 16:03:11 -0400 |
commit | d3a9ae31978538f7d43b70a8b99ebc9580a9ab62 (patch) | |
tree | d1fd6818d5489bdbf3bcbe6cbac7eb27011a539a /Types | |
parent | 9428ea01ffb76eeb049ba81d7246084df13187cb (diff) |
start to support core.symlinks=false
Utility functions to handle no symlink mode, and converted Annex.Content to
use them; still many other places to convert.
Diffstat (limited to 'Types')
-rw-r--r-- | Types/GitConfig.hs | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/Types/GitConfig.hs b/Types/GitConfig.hs index 014a409e1..2430a73a7 100644 --- a/Types/GitConfig.hs +++ b/Types/GitConfig.hs @@ -36,38 +36,40 @@ data GitConfig = GitConfig , annexAutoCommit :: Bool , annexWebOptions :: [String] , annexCrippledFileSystem :: Bool + , coreSymlinks :: Bool } extractGitConfig :: Git.Repo -> GitConfig extractGitConfig r = GitConfig - { annexVersion = notempty $ getmaybe "version" - , annexNumCopies = get "numcopies" 1 + { annexVersion = notempty $ getmaybe (annex "version") + , annexNumCopies = get (annex "numcopies") 1 , annexDiskReserve = fromMaybe onemegabyte $ - readSize dataUnits =<< getmaybe "diskreserve" - , annexDirect = getbool "direct" False - , annexBackends = getwords "backends" - , annexQueueSize = getmayberead "queuesize" - , annexBloomCapacity = getmayberead "bloomcapacity" - , annexBloomAccuracy = getmayberead "bloomaccuracy" - , annexSshCaching = getmaybebool "sshcaching" - , annexAlwaysCommit = getbool "alwayscommit" True - , annexDelayAdd = getmayberead "delayadd" - , annexHttpHeaders = getlist "http-headers" - , annexHttpHeadersCommand = getmaybe "http-headers-command" - , annexAutoCommit = getbool "autocommit" True - , annexWebOptions = getwords "web-options" - , annexCrippledFileSystem = getbool "crippledfilesystem" False + readSize dataUnits =<< getmaybe (annex "diskreserve") + , annexDirect = getbool (annex "direct") False + , annexBackends = getwords (annex "backends") + , annexQueueSize = getmayberead (annex "queuesize") + , annexBloomCapacity = getmayberead (annex "bloomcapacity") + , annexBloomAccuracy = getmayberead (annex "bloomaccuracy") + , annexSshCaching = getmaybebool (annex "sshcaching") + , annexAlwaysCommit = getbool (annex "alwayscommit") True + , annexDelayAdd = getmayberead (annex "delayadd") + , annexHttpHeaders = getlist (annex "http-headers") + , annexHttpHeadersCommand = getmaybe (annex "http-headers-command") + , annexAutoCommit = getbool (annex "autocommit") True + , annexWebOptions = getwords (annex "web-options") + , annexCrippledFileSystem = getbool (annex "crippledfilesystem") False + , coreSymlinks = getbool "core.symlinks" True } where get k def = fromMaybe def $ getmayberead k getbool k def = fromMaybe def $ getmaybebool k getmaybebool k = Git.Config.isTrue =<< getmaybe k getmayberead k = readish =<< getmaybe k - getmaybe k = Git.Config.getMaybe (key k) r - getlist k = Git.Config.getList (key k) r + getmaybe k = Git.Config.getMaybe k r + getlist k = Git.Config.getList k r getwords k = fromMaybe [] $ words <$> getmaybe k - key k = "annex." ++ k + annex k = "annex." ++ k onemegabyte = 1000000 |