From: Joey Hess Date: Tue, 29 Jun 2021 17:21:21 +0000 (-0400) Subject: avoid using CopyFile X-Git-Tag: archive/raspbian/10.20250416-2+rpi1~2^2^2~69^2~164 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=75d29de8d497e603b2768f0d9d34d1f36ac3d39f;p=git-annex.git avoid using CopyFile If .git/config symlinks are ever a thing, this will handle them better. But mostly, this is to avoid git-repair needing to include CopyFile, which would complicate it unduely. --- diff --git a/Git/Repair.hs b/Git/Repair.hs index df5608a014..144c96fd60 100644 --- a/Git/Repair.hs +++ b/Git/Repair.hs @@ -42,7 +42,6 @@ import Utility.Directory.Create import Utility.Tmp.Dir import Utility.Rsync import Utility.FileMode -import Utility.CopyFile import qualified Utility.RawFilePath as R import qualified Data.Set as S @@ -116,12 +115,10 @@ retrieveMissingObjects missing referencerepo r | otherwise = withTmpDir "tmprepo" $ \tmpdir -> do unlessM (boolSystem "git" [Param "init", File tmpdir]) $ error $ "failed to create temp repository in " ++ tmpdir - let repoconfig r' = fromRawFilePath (localGitDir r' P. "config") tmpr <- Config.read =<< Construct.fromPath (toRawFilePath tmpdir) + let repoconfig r' = fromRawFilePath (localGitDir r' P. "config") whenM (doesFileExist (repoconfig r)) $ - void $ copyFileExternal CopyAllMetaData - (repoconfig r) - (repoconfig tmpr) + L.readFile (repoconfig r) >>= L.writeFile (repoconfig tmpr) rs <- Construct.fromRemotes r stillmissing <- pullremotes tmpr rs fetchrefstags missing if S.null (knownMissing stillmissing)