Fix upgrade failure when a file has been deleted from the working tree
authorJoey Hess <joeyh@joeyh.name>
Mon, 9 Mar 2020 20:59:18 +0000 (16:59 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 9 Mar 2020 20:59:18 +0000 (16:59 -0400)
CHANGELOG
Upgrade/V7.hs
doc/bugs/upgrade_to_V8_fails.mdwn
doc/bugs/upgrade_to_V8_fails/comment_4_98739a9ae1bad44add6245fcded692c5._comment [new file with mode: 0644]

index 031b7460974b03a1e7f98afeff79b24e53931d3c..d403afed1a26a3ddc035d881add472a1b0c61072 100644 (file)
--- 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.
index 519d1f3919debcb6e021ed558fb6439663dfc538..f006e2291deea144a3a377b56f7b2913361e5037 100644 (file)
@@ -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
index 015ee3d6e9290096205381d00d7fb9a23dbf26d2..5f9069affa5915ab315576f030d32d6f80842594 100644 (file)
@@ -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 (file)
index 0000000..b4d03f2
--- /dev/null
@@ -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.
+"""]]