upgrade: Avoid an upgrade failure of a bare repo in unusual circumstances
authorJoey Hess <joeyh@joeyh.name>
Tue, 29 Sep 2020 17:45:14 +0000 (13:45 -0400)
committerJoey Hess <joeyh@joeyh.name>
Tue, 29 Sep 2020 17:45:14 +0000 (13:45 -0400)
CHANGELOG
Upgrade/V7.hs
doc/bugs/fatal__58___relative_path_syntax_can__39__t_be_used_outside_working_tree.mdwn
doc/bugs/fatal__58___relative_path_syntax_can__39__t_be_used_outside_working_tree/comment_1_68de6f1477d91e769aae8d565c5f37cb._comment [new file with mode: 0644]

index 905f1639449b0bb2ebde602dcb240038b81b4ddc..3f69e857bb3a3c3c4b3f8c5951b6ddbd28338386 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -31,6 +31,7 @@ git-annex (8.20200909) UNRELEASED; urgency=medium
     importtree=yes directory special remotes.
     (Other special remotes may support this later as well.)
   * addurl: Avoid a redundant git ignores check for speed.
+  * upgrade: Avoid an upgrade failure of a bare repo in unusual circumstances.
 
  -- Joey Hess <id@joeyh.name>  Mon, 14 Sep 2020 18:34:37 -0400
 
index f006e2291deea144a3a377b56f7b2913361e5037..c9d6d21c3785d8a218310871ff0ed4a948bc7acf 100644 (file)
@@ -96,7 +96,7 @@ removeOldDb getdb = do
 -- annex object. That work is only done once, and then the object will
 -- finally get its inode cached.
 populateKeysDb :: Annex ()
-populateKeysDb = do
+populateKeysDb = unlessM isBareRepo $ do
        top <- fromRepo Git.repoPath
        (l, cleanup) <- inRepo $ LsFiles.inodeCaches [top]
        forM_ l $ \case
index 503c8bd0b0d6641bed760f52d8f0a8a3c5d97da1..1e30801ca08305d6375d966cbf47f50d73b93096 100644 (file)
@@ -40,3 +40,5 @@ git-annex: user error (git ["--git-dir=.","--literal-pathspecs","cat-file","--ba
 ### Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders)
 
 Yes! We love it! Thank you so much! Git-annex is a superpower 🦹‍♂️ 
+
+> [[fixed|done]] --[[Joey]]
diff --git a/doc/bugs/fatal__58___relative_path_syntax_can__39__t_be_used_outside_working_tree/comment_1_68de6f1477d91e769aae8d565c5f37cb._comment b/doc/bugs/fatal__58___relative_path_syntax_can__39__t_be_used_outside_working_tree/comment_1_68de6f1477d91e769aae8d565c5f37cb._comment
new file mode 100644 (file)
index 0000000..ae979cb
--- /dev/null
@@ -0,0 +1,33 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2020-09-29T17:34:03Z"
+ content="""
+I have not been able to reproduce this so far in a usual environment.
+
+It doesn't even run `git cat-file` in my testing, let alone do
+anything with it that fails.
+
+AFAICS, for `git cat-file` to run, the `git ls-files --cached` that it does
+run would have to otput some filenames. Which should be impossible normally
+in a bare repository, because there is no index file in a bare repo.
+
+So, there is something unusual about your repository 
+or environment.
+
+Here are two ways to reproduce that failure:
+
+* Set `GIT_INDEX_FILE` to point to an index file belonging to some other
+  git repository.
+* Copy .git/index from some other repository into the bare repository.
+
+I guess you, or some past buggy thing, could have done the latter.
+Or perhaps you did the former and forgot about the envionment setting?
+
+Anyway, I'll make git-annex check if it's a bare repo and skip this
+part entirely, but really it seems to me that either of those possibilities
+is pretty far into foot shooting territory and if git-annex explodes
+because you're doing stuff like that, it's hardly a bug. Of course,
+if you can somehow rule out both possibilities, that would be a different
+story.
+"""]]