Remaining calls in the assistant and Annex.Ssh have been audited and are ok.
sshSocketDirEnv :: String
sshSocketDirEnv = "GIT_ANNEX_SSH_SOCKET_DIR"
-{- ssh connection caching creates sockets, so will not work on a
- - crippled filesystem. -}
+{- Returns the directory where ssh connection caching sockets can be
+ - stored.
+ -
+ - The directory will be created if it does not exist.
+ -}
sshCacheDir :: Annex (Maybe FilePath)
sshCacheDir = eitherToMaybe <$> sshCacheDir'
Just tmpdir ->
liftIO $ catchMsgIO $
usetmpdir tmpdir
- , Right <$> fromRepo gitAnnexSshDir
+ , do
+ d <- fromRepo gitAnnexSshDir
+ createAnnexDirectory d
+ return (Right d)
)
, return (Left "annex.sshcaching is not set to true")
)
-- Cleanup at shutdown.
Annex.addCleanup SshCachingCleanup sshCleanup
- liftIO $ createDirectoryIfMissing True $ parentDir socketfile
let socketlock = socket2lock socketfile
Annex.getState Annex.concurrency >>= \case
mergeThread :: NamedThread
mergeThread = namedThread "Merger" $ do
g <- liftAnnex gitRepo
- let dir = fromRawFilePath (Git.localGitDir g) </> "refs"
- liftIO $ createDirectoryIfMissing True dir
+ let gitd = fromRawFilePath (Git.localGitDir g)
+ let dir = gitd </> "refs"
+ liftIO $ createDirectoryUnder gitd dir
let hook a = Just <$> asIO2 (runHandler a)
changehook <- hook onChange
errhook <- hook onErr
import Utility.DirWatcher
import Utility.DirWatcher.Types
import qualified Remote
+import Annex.Perms
import Control.Concurrent
import qualified Data.Map as M
transferWatcherThread :: NamedThread
transferWatcherThread = namedThread "TransferWatcher" $ do
dir <- liftAnnex $ gitAnnexTransferDir <$> gitRepo
- liftIO $ createDirectoryIfMissing True dir
+ liftAnnex $ createAnnexDirectory dir
let hook a = Just <$> asIO2 (runHandler a)
addhook <- hook onAdd
delhook <- hook onDel
import Types.Crypto
import Utility.Gpg
import Annex.UUID
+import Annex.Perms
import Assistant.Ssh
import Config
import Config.GitConfig
repoconfig <- M.lookup (Remote.uuid r) <$> readRemoteLog
case repoGroup cfg of
RepoGroupStandard gr -> case associatedDirectory repoconfig gr of
- Just d -> inRepo $ \g ->
- createDirectoryIfMissing True $
- fromRawFilePath (Git.repoPath g) </> d
+ Just d -> do
+ top <- fromRawFilePath <$> fromRepo Git.repoPath
+ createWorkTreeDirectory (top </> d)
Nothing -> noop
_ -> noop
git-annex (8.20200227) UNRELEASED; urgency=medium
+ * Improve behavior when a directory git-annex is writing to gets
+ unmounted. Previously it could in some cases re-create the mount point
+ and directory tree, and even write object contents to the wrong disk.
* Bugfix: Don't ignore --debug when it is followed by -c.
* whereis: If a remote fails to report on urls where a key
is located, display a warning, rather than giving up and not displaying
on what's being done. --[[Joey]]
[[!tag confirmed]]
+
+> [[fixed|done]], all relevant calls have been converted. --[[Joey]]