syncthing/lib/versioner
nf 8b321387c0
lib/versioner: Expand tildes in version directory (fixes #9241) (#9327)
### Purpose

Fix #9241 by expanding tildes in version paths.

When creating the versioner file system, first try to expand any leading
tildes to the user's home directory before handling relative paths. This
makes a version path `"~/p"` expand to `"$HOME/p"` instead of
`"/folder/~/p"`.

### Testing

Added a test to lib/versioner that exercises this code path. Also
manually tested with local syncthing instances.
2024-01-12 10:46:18 +01:00
..
_external_test lib/versioner: Test both spaces and parens in ext versioner paths 2016-09-18 12:24:55 +00:00
.gitignore mv internal lib 2015-08-09 09:35:26 +02:00
debug.go all, lib/logger: Refactor SetDebug calls (#6054) 2019-10-04 13:03:34 +02:00
empty_dir_tracker.go all: replace empty slice literal with `var` (#8990) 2023-07-18 14:44:37 +00:00
empty_dir_tracker_test.go build: Update quic-go for Go 1.19 (#8483) 2022-08-03 15:43:26 +02:00
external.go all: replace empty slice literal with `var` (#8990) 2023-07-18 14:44:37 +00:00
external_test.go all: Add build constants for runtime.GOOS comparisons (#8442) 2022-07-28 19:36:39 +02:00
simple.go lib/versioner: Minor fixes in comments and error message (#9031) 2023-08-09 07:10:06 +00:00
simple_test.go lib/versioner: Expand tildes in version directory (fixes #9241) (#9327) 2024-01-12 10:46:18 +01:00
staggered.go lib/versioner: Fix cleaning behaviour (fixes #7988) (#8537) 2022-09-13 19:21:42 +02:00
staggered_test.go all: use T.TempDir to create temporary test directory (#8280) 2022-04-15 07:44:06 +04:00
trashcan.go lib/versioner: Fix error in Trashcan restore (fixes: #7965) (#8549) 2022-09-20 11:34:15 +02:00
trashcan_test.go all: Minor staticcheck fixes (#8939) 2023-06-19 06:50:53 +00:00
util.go lib/versioner: Expand tildes in version directory (fixes #9241) (#9327) 2024-01-12 10:46:18 +01:00
versioner.go lib/versioner: Minor fixes in comments and error message (#9031) 2023-08-09 07:10:06 +00:00