diff options
-rwxr-xr-x[-rw-r--r--] | Annex/Content/Direct.hs | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | Init.hs | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/Annex/Content/Direct.hs b/Annex/Content/Direct.hs index 3560c8b6c..b885b5e5b 100644..100755 --- a/Annex/Content/Direct.hs +++ b/Annex/Content/Direct.hs @@ -110,7 +110,7 @@ goodContent key file = sameInodeCache file =<< recordedInodeCache key recordedInodeCache :: Key -> Annex [InodeCache] recordedInodeCache key = withInodeCacheFile key $ \f -> liftIO $ catchDefaultIO [] $ - mapMaybe readInodeCache . lines <$> readFile f + mapMaybe readInodeCache . lines <$> readFileStrict f {- Caches an inode for a file. - @@ -18,6 +18,7 @@ module Init ( import Common.Annex import Utility.Tmp 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__ |