diff options
author | Joey Hess <id@joeyh.name> | 2013-05-13 19:48:44 -0500 |
---|---|---|
committer | Joey Hess <id@joeyh.name> | 2013-05-13 19:48:44 -0500 |
commit | 13c19fb0a0d1df6bfdd9ba2bca3eb45d624015d5 (patch) | |
tree | f6be51da65d7f23e1c57ec0bb6c2523d024c4498 /Init.hs | |
parent | e6f0aac11f08ebc3a7e8e9b343b7c8b866cb2e25 (diff) |
disable core.symlinks explicitly on crippled filesystem
Needed to make git annex drop work on cygwin, where git keeps it enabled.
I think git can indeed make symlinks on Cygwin, due to being linked to
the library. git-annex, however, cannot.
Diffstat (limited to 'Init.hs')
-rwxr-xr-x[-rw-r--r--] | Init.hs | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -18,6 +18,7 @@ module Init ( import Common.Annex import Utility.TempFile import Utility.Network +import qualified Annex import qualified Git import qualified Git.LsFiles import qualified Git.Config @@ -117,6 +118,8 @@ preCommitScript = unlines , "git annex pre-commit ." ] +{- A crippled filesystem is one that does not allow making symlinks, + - or removing write access from files. -} probeCrippledFileSystem :: Annex Bool probeCrippledFileSystem = do #ifdef __WINDOWS__ @@ -147,6 +150,7 @@ checkCrippledFileSystem :: Annex () checkCrippledFileSystem = whenM probeCrippledFileSystem $ do warning "Detected a crippled filesystem." setCrippledFileSystem True + unlessM isDirect $ do warning "Enabling direct mode." top <- fromRepo Git.repoPath @@ -157,6 +161,14 @@ checkCrippledFileSystem = whenM probeCrippledFileSystem $ do setDirect True setVersion directModeVersion + {- Normally git disables core.symlinks itself when the filesystem does + - not support them, but in Cygwin, git does support symlinks, while + - git-annex, not linking with Cygwin, does not. -} + whenM (coreSymlinks <$> Annex.getGitConfig) $ do + warning "Disabling core.symlinks." + setConfig (ConfigKey "core.symlinks") + (Git.Config.boolConfig False) + probeFifoSupport :: Annex Bool probeFifoSupport = do #ifdef __WINDOWS__ |