Fix support for readonly git remotes
authorJoey Hess <joeyh@joeyh.name>
Mon, 30 Aug 2021 16:34:19 +0000 (12:34 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 30 Aug 2021 16:34:19 +0000 (12:34 -0400)
Boolean blindness oops.

(Reversion in version 8.20210621)

Sponsored-by: Dartmouth College's Datalad project
CHANGELOG
Database/Keys.hs
doc/bugs/unable_to_get_content_via_ssh_without_write_perms/comment_3_a4f9bb23f0682a66e951b96aed6ae214._comment [new file with mode: 0644]

index ab4f9202caddcad055970009cf8472fae2fa409d..897b0100721b7c781c2761cb9936edcd3d95844c 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -24,6 +24,8 @@ git-annex (8.20210804) UNRELEASED; urgency=medium
     servers.
   * add: Detect when xattrs or perhaps ACLs prevent locking down
     a file's content, and fail with an informative message.
+  * Fix support for readonly git remotes.
+    (Reversion in version 8.20210621)
 
  -- Joey Hess <id@joeyh.name>  Tue, 03 Aug 2021 12:22:45 -0400
 
index 04fef03d2a710346e0a2d044cdcb032427914da0..4aeee67bd1c3a2cb773037f7262e78fd7fcba29e 100644 (file)
@@ -75,7 +75,7 @@ runReader a = do
                v <- a (SQL.ReadHandle qh)
                return (v, st)
        go DbClosed = do
-               st' <- openDb True DbClosed
+               st' <- openDb False DbClosed
                v <- case st' of
                        (DbOpen qh) -> a (SQL.ReadHandle qh)
                        _ -> return mempty
@@ -97,7 +97,7 @@ runWriter a = do
                v <- a (SQL.WriteHandle qh)
                return (v, st)
        go st = do
-               st' <- openDb False st
+               st' <- openDb True st
                v <- case st' of
                        DbOpen qh -> a (SQL.WriteHandle qh)
                        _ -> error "internal"
diff --git a/doc/bugs/unable_to_get_content_via_ssh_without_write_perms/comment_3_a4f9bb23f0682a66e951b96aed6ae214._comment b/doc/bugs/unable_to_get_content_via_ssh_without_write_perms/comment_3_a4f9bb23f0682a66e951b96aed6ae214._comment
new file mode 100644 (file)
index 0000000..dc74a9b
--- /dev/null
@@ -0,0 +1,13 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 3"""
+ date="2021-08-30T16:24:52Z"
+ content="""
+reversion in [[!commit f46e4c9b7c]], which reversed some logic and made
+database reads be treated as database writes, so they failed on permission
+denied, rather than the right behavior of returning DbUnavailable. Fixed that. 
+
+I have not been able to reproduce the other error involving
+opening a temp file. All I can tell from the message is that it's writing
+to some file in .git/annex via a temp file in the same directory.
+"""]]