From: Joey Hess Date: Mon, 9 Mar 2020 20:59:18 +0000 (-0400) Subject: Fix upgrade failure when a file has been deleted from the working tree X-Git-Tag: archive/raspbian/10.20250416-2+rpi1~1^2~126^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=4ce518998a2b3942b5ca32700259c0600d02fb14;p=git-annex.git Fix upgrade failure when a file has been deleted from the working tree --- diff --git a/CHANGELOG b/CHANGELOG index 031b746097..d403afed1a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -9,6 +9,7 @@ git-annex (8.20200227) UNRELEASED; urgency=medium that the cwd will be inside the repo being upgraded. In particular, this fixes a problem where upgrading a v7 repo to v8 caused an ugly git error message. + * Fix upgrade failure when a file has been deleted from the working tree. * 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. diff --git a/Upgrade/V7.hs b/Upgrade/V7.hs index 519d1f3919..f006e2291d 100644 --- a/Upgrade/V7.hs +++ b/Upgrade/V7.hs @@ -101,7 +101,7 @@ populateKeysDb = do (l, cleanup) <- inRepo $ LsFiles.inodeCaches [top] forM_ l $ \case (_f, Nothing) -> giveup "Unable to parse git ls-files --debug output while upgrading git-annex sqlite databases." - (f, Just ic) -> unlessM (liftIO $ isSymbolicLink <$> getSymbolicLinkStatus f) $ do + (f, Just ic) -> unlessM (liftIO $ catchBoolIO $ isSymbolicLink <$> getSymbolicLinkStatus f) $ do catKeyFile (toRawFilePath f) >>= \case Nothing -> noop Just k -> do diff --git a/doc/bugs/upgrade_to_V8_fails.mdwn b/doc/bugs/upgrade_to_V8_fails.mdwn index 015ee3d6e9..5f9069affa 100644 --- a/doc/bugs/upgrade_to_V8_fails.mdwn +++ b/doc/bugs/upgrade_to_V8_fails.mdwn @@ -33,3 +33,5 @@ the error first apperard in 8.20200226-5 everything worked like a charm until this recent change + +> [[fixed|done]] --[[Joey]] diff --git a/doc/bugs/upgrade_to_V8_fails/comment_4_98739a9ae1bad44add6245fcded692c5._comment b/doc/bugs/upgrade_to_V8_fails/comment_4_98739a9ae1bad44add6245fcded692c5._comment new file mode 100644 index 0000000000..b4d03f2093 --- /dev/null +++ b/doc/bugs/upgrade_to_V8_fails/comment_4_98739a9ae1bad44add6245fcded692c5._comment @@ -0,0 +1,17 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 4""" + date="2020-03-09T20:53:45Z" + content=""" +I was able to reverse engineer the error message by deleting one of the +file in the git repository, but not staging the deletion. + +That does not seem to match what you were saying about the symlink +existing, but perhaps it was upgrading some other repository where +the file was deleted, or very likely I am failing to understand what you +were trying to explain. + +Since what I've fixed is the only way it could throw that exception, I'm +going to assume this bug is fixed, but if you try the next version of +git-annex and it still has the problem, do follow up. +"""]]