* Fixed bug that interrupting git-annex repair (or assistant) while
it was fixing repository corruption would lose objects that were
contained in pack files.
+ * repair: Fix reversion in version 8.20200522 that prevented fetching
+ missing objects from remotes.
-- Joey Hess <id@joeyh.name> Mon, 21 Jun 2021 12:25:25 -0400
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
| 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)
+ whenM (doesFileExist (repoconfig r)) $
+ void $ copyFileExternal CopyAllMetaData
+ (repoconfig r)
+ (repoconfig tmpr)
rs <- Construct.fromRemotes r
stillmissing <- pullremotes tmpr rs fetchrefstags missing
if S.null (knownMissing stillmissing)