fix view reversion caused by optimisation

view: Fix a reversion in 10.20230214 that omitted a file from a view when
the file had no metadata set, but the view only used path fields.

Sponsored-by: Jack Hill on Patreon
This commit is contained in:
Joey Hess 2023-02-16 15:06:44 -04:00
parent 1c2e5b4519
commit da61d564f1
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 21 additions and 2 deletions

View file

@ -489,8 +489,8 @@ applyView'' mkviewedfile getfilemetadata view l clean conv = do
getmetadata gc mdfeeder mdcloser ts
process uh mdreader = liftIO mdreader >>= \case
Just ((topf, _, _, Just k), Just mdlog) -> do
let metadata = parseCurrentMetaData mdlog
Just ((topf, _, _, Just k), mdlog) -> do
let metadata = maybe emptyMetaData parseCurrentMetaData mdlog
let f = fromRawFilePath $ getTopFilePath topf
let metadata' = getfilemetadata f `unionMetaData` metadata
forM_ (genviewedfiles f metadata') $ \fv -> do

View file

@ -3,6 +3,8 @@ git-annex (10.20230215) UNRELEASED; urgency=medium
* Fix more breakage caused by git's fix for CVE-2022-24765, this time
involving a remote that is a local bare repository not owned by the
current user.
* view: Fix a reversion in 10.20230214 that omitted a file from a view
when the file had no metadata set, but the view only used path fields.
* stack.yaml: Update to lts-19.33 and aws-0.24
-- Joey Hess <id@joeyh.name> Tue, 14 Feb 2023 14:11:11 -0400

View file

@ -113,3 +113,4 @@ Mode LastWriteTime Length Name
[[!meta author=jkniiv]]
> [[fixed|done]] --[[Joey]]

View file

@ -0,0 +1,16 @@
[[!comment format=mdwn
username="joey"
subject="""comment 1"""
date="2023-02-16T18:55:06Z"
content="""
I'm surprised by this behavior change! (And I replicated it on linux, no
apologies necessary for also testing Windows support..)
[[!commit 826b225ca81d469640e51628865dbd64a1d37773]] is the buggy commit.
When there is no metadata log, it accidentially skips calling
getfilemetadata.
I've fixed that. I wonder if I should push up the shedule of the next
release because of this reversion? Currently I'm inclined to treat it as
medium urgency for release (1-2 weeks).
"""]]