Commit Graph
5 Commits
Author SHA1 Message Date
kevin9327 e49f3350ab lib/version: only match a version string at the end of the base name
version.Match searched the whole path for a version-like string, while
Add only puts one at the end of the base name and Remove only looks
there. So a current file such as notes-v2024-01-02-030405-678-final.txt
or anything under a directory named like dir-v2024-01-02-030405-678/
was treated as an old version.

In the s3 backend this made rclone cleanup on a versioned bucket delete
the current version of such files, and with --s3-versions NewObject
looked them up in the version listing.

Match now checks the base name returned by splitExt, the same place
Add and Remove use.
2026-11-11 11:03:33 +00:00
albertony ec117593f1 Fix lint issues reported by staticcheck
Used staticcheck 2022.1.2 (v0.3.2)

See: staticcheck.io
2022-06-13 21:13:50 +02:00
Eng Zer Jun 4f0ddb60e7 refactor: replace strings.Replace with strings.ReplaceAll
strings.ReplaceAll(s, old, new) is a wrapper function for
strings.Replace(s, old, new, -1). But strings.ReplaceAll is more
readable and removes the hardcoded -1.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-05-17 11:08:37 +01:00
Nick Craig-Wood 06f27384dd b2: fix versions and .files with no extension - fixes #5244 2021-05-17 16:20:29 +01:00
Dominik Mydlil c163e6b250 b2: factor version handling into lib/version
Standardizes the filename version tagging so that it can be used by any
backend.
2021-04-12 15:59:18 +01:00