diff --git a/Annex/View.hs b/Annex/View.hs index 9cbf9110fc..0dc9ee033b 100644 --- a/Annex/View.hs +++ b/Annex/View.hs @@ -253,7 +253,8 @@ toViewPath = escapepseudo [] . decodeBS . fromMetaValue | [c1,c2,c3] == pseudoBackslash = escapepseudo ("%":pseudoBackslash:s) cs | [c1,c2,c3] == pseudoColon = escapepseudo ("%":pseudoColon:s) cs | otherwise = escapepseudo ([c1]:s) (c2:c3:cs) - escapepseudo s cs = concat (reverse (cs:s)) + escapepseudo s (c:cs) = escapepseudo ([c]:s) cs + escapepseudo s [] = concat (reverse s) fromViewPath :: FilePath -> MetaValue fromViewPath = toMetaValue . encodeBS . deescapepseudo [] diff --git a/CHANGELOG b/CHANGELOG index 3b9bd58ef2..ef2a84fc78 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -34,6 +34,8 @@ git-annex (8.20201130) UNRELEASED; urgency=medium overhead when inodes of files have changed, as happens whenever a FAT filesystem gets remounted. * Fix a bug that prevented git-annex init from working in a submodule. + * Fix a bug in view filename generation when a metadata value ended with + "/" (or ":" or "\" on Windows) -- Joey Hess Mon, 04 Jan 2021 12:52:41 -0400 diff --git a/doc/bugs/1_test_failure_under_conda_on_Windows_10__58___prop__95__view__95__roundtrips/comment_4_c2f248745388b508337c5097baaa1979._comment b/doc/bugs/1_test_failure_under_conda_on_Windows_10__58___prop__95__view__95__roundtrips/comment_4_c2f248745388b508337c5097baaa1979._comment new file mode 100644 index 0000000000..1cf72d1acb --- /dev/null +++ b/doc/bugs/1_test_failure_under_conda_on_Windows_10__58___prop__95__view__95__roundtrips/comment_4_c2f248745388b508337c5097baaa1979._comment @@ -0,0 +1,18 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 4""" + date="2021-01-22T16:59:55Z" + content=""" +Not sure if this is really the same bug, though certainly related. These +quickcheck tests are fuzz tests, they can find numerous bugs, that's kind of +the point of them. In any case, posting to a closed bug report risks your +followup being lost and deprioritises it. + +The problem this new failure shows is that toViewPath is failing to escape the +final character in the path in some cases. Which is not a windows-specific +bug at all really, it could also happen with a metadata value such as "foo/" +being set on linux. Fixed that bug. + +Which shows the point of these quickcheck fuzz tests: To be able to catch +lots of different bugs with a single test case. +"""]]