From 700be6c38f29328812c17048c077c9bec7d8d8ad Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 11 Nov 2024 12:42:26 -0400 Subject: [PATCH] git-remote-annex: Fix a reversion Introduced in version 10.20241031 that broke cloning from a special remote retrieveKeyFile changed to use createAnnexDirectory, which means that the path passed to it needs to be under .git git-remote-annex is probably the only thing in git-annex where that was not the case. And there's no real reason it cannot be the case with it either. Just use withOtherTmp. --- CHANGELOG | 7 +++++++ CmdLine/GitRemoteAnnex.hs | 16 +++++++++------- ...t_2_6dda2cfd76732792a373ea2cc359ffb3._comment | 11 +++++++++++ 3 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 doc/bugs/git-remote-annex_fails_createDirectoryFrom_not_located_in_git/comment_2_6dda2cfd76732792a373ea2cc359ffb3._comment diff --git a/CHANGELOG b/CHANGELOG index 584ab7deda..b025184df3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,10 @@ +git-annex (10.20241032) UNRELEASED; urgency=medium + + * git-remote-annex: Fix a reversion introduced in version 10.20241031 + that broke cloning from a special remote. + + -- Joey Hess Mon, 11 Nov 2024 12:26:00 -0400 + git-annex (10.20241031) upstream; urgency=medium * Sped up proxied downloads from special remotes, by streaming. diff --git a/CmdLine/GitRemoteAnnex.hs b/CmdLine/GitRemoteAnnex.hs index 5d95c34bb1..36d2446e4e 100644 --- a/CmdLine/GitRemoteAnnex.hs +++ b/CmdLine/GitRemoteAnnex.hs @@ -48,6 +48,7 @@ import Annex.Init import Annex.UUID import Annex.Content import Annex.Perms +import Annex.Tmp import Annex.SpecialRemote.Config import Remote.List import Remote.List.Util @@ -719,13 +720,14 @@ downloadManifest rmt = get mkmain >>= maybe (get mkbak) (pure . Just) -- directory. The content of manifests is not stable, and so -- it needs to re-download it fresh every time, and the object -- file should not be stored locally. - gettotmp dl = withTmpFile "GITMANIFEST" $ \tmp tmph -> do - liftIO $ hClose tmph - _ <- dl tmp - b <- liftIO (B.readFile tmp) - case parseManifest b of - Right m -> Just <$> verifyManifest rmt m - Left err -> giveup err + gettotmp dl = withOtherTmp $ \othertmp -> + withTmpFileIn (fromRawFilePath othertmp) "GITMANIFEST" $ \tmp tmph -> do + liftIO $ hClose tmph + _ <- dl tmp + b <- liftIO (B.readFile tmp) + case parseManifest b of + Right m -> Just <$> verifyManifest rmt m + Left err -> giveup err getexport _ [] = return Nothing getexport mk (loc:locs) = diff --git a/doc/bugs/git-remote-annex_fails_createDirectoryFrom_not_located_in_git/comment_2_6dda2cfd76732792a373ea2cc359ffb3._comment b/doc/bugs/git-remote-annex_fails_createDirectoryFrom_not_located_in_git/comment_2_6dda2cfd76732792a373ea2cc359ffb3._comment new file mode 100644 index 0000000000..483abc4279 --- /dev/null +++ b/doc/bugs/git-remote-annex_fails_createDirectoryFrom_not_located_in_git/comment_2_6dda2cfd76732792a373ea2cc359ffb3._comment @@ -0,0 +1,11 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 2""" + date="2024-11-11T16:39:48Z" + content=""" +Fixed by changing it to download to a path under .git + +Also, this directory special remote case makes a good test case so I will +add it to the test suite, which will be the first git-remote-annex in the +test suite. +"""]]