diff --git a/CHANGELOG b/CHANGELOG index 254f914b59..7e523186c6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -15,6 +15,8 @@ git-annex (10.20241032) UNRELEASED; urgency=medium unversioned S3 bucket that is large enough to need pagination. * S3: Use significantly less memory when importing from a versioned S3 bucket. + * git-remote-annex: Fix cloning from a special remote on a crippled + filesystem. -- Joey Hess Mon, 11 Nov 2024 12:26:00 -0400 diff --git a/CmdLine/GitRemoteAnnex.hs b/CmdLine/GitRemoteAnnex.hs index 36d2446e4e..89ded7191c 100644 --- a/CmdLine/GitRemoteAnnex.hs +++ b/CmdLine/GitRemoteAnnex.hs @@ -1129,7 +1129,7 @@ specialRemoteFromUrl sab a = withTmpDir "journal" $ \tmpdir -> do -- If the git-annex branch did not exist when this command started, -- it was created empty by this command, and this command has avoided -- making any other commits to it, writing any temporary annex branch --- changes to thre alternateJournal, which can now be discarded. +-- changes to the alternateJournal, which can now be discarded. -- -- If nothing else has written to the branch while this command was running, -- the branch will be deleted. That allows for the git-annex branch that is @@ -1152,6 +1152,11 @@ specialRemoteFromUrl sab a = withTmpDir "journal" $ \tmpdir -> do -- does not contain any hooks. Since initialization installs -- hooks, have to work around that by not initializing, and -- delete the git bundle objects. +-- +-- Similarly, when on a crippled filesystem, doing initialization would +-- involve checking out an adjusted branch. But git clone wants to do its +-- own checkout. So no initialization is done then, and the git bundle +-- objects are deleted. cleanupInitialization :: StartAnnexBranch -> FilePath -> Annex () cleanupInitialization sab alternatejournaldir = void $ tryNonAsync $ do liftIO $ mapM_ removeFile =<< dirContents alternatejournaldir @@ -1173,7 +1178,7 @@ cleanupInitialization sab alternatejournaldir = void $ tryNonAsync $ do Nothing -> return () Just _ -> void $ tryNonAsync $ inRepo $ Git.Branch.delete Annex.Branch.fullname - ifM (Annex.Branch.hasSibling <&&> nonbuggygitversion) + ifM (Annex.Branch.hasSibling <&&> nonbuggygitversion <&&> notcrippledfilesystem) ( do autoInitialize' (pure True) startupAnnex remoteList differences <- allDifferences <$> recordedDifferences @@ -1190,6 +1195,8 @@ cleanupInitialization sab alternatejournaldir = void $ tryNonAsync $ do _ -> noop void $ liftIO $ tryIO $ removeDirectory (decodeBS annexobjectdir) + notcrippledfilesystem = not <$> probeCrippledFileSystem + nonbuggygitversion = liftIO $ flip notElem buggygitversions <$> Git.Version.installed buggygitversions = map Git.Version.normalize diff --git a/doc/bugs/tests_started_to_fail_recently/comment_1_c07a23f5d8524ba8f97187ade6eeb441._comment b/doc/bugs/tests_started_to_fail_recently/comment_1_c07a23f5d8524ba8f97187ade6eeb441._comment new file mode 100644 index 0000000000..8f4197908f --- /dev/null +++ b/doc/bugs/tests_started_to_fail_recently/comment_1_c07a23f5d8524ba8f97187ade6eeb441._comment @@ -0,0 +1,17 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2024-11-19T16:18:31Z" + content=""" +This is a new test. + +Looks like it's found a legitimate bug in git-remote-annex. When the +filesystem is crippled, the git-annex init checks out an adjusted branch, +which here happens in the middle of git's own checkout and so legitimately +confuses git. + +I can reproduce this on a FAT filesystem, cloning from eg a directory +special remote. Fixed this. + +(The OSX failure is something else.) +"""]]