mirror of
https://github.com/octoleo/restic.git
synced 2024-11-26 14:56:29 +00:00
dump: Use path instead of filepath
Some time ago we changed the paths in the repo to always use a slash for separation, it seems we missed that the `dump` command still uses the `filepath` package, so on Windows backslashes are used. Closes #2079
This commit is contained in:
parent
c0572ca15f
commit
8471a359ee
@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/restic/restic/internal/debug"
|
||||
@ -47,12 +48,12 @@ func init() {
|
||||
flags.StringArrayVar(&dumpOptions.Paths, "path", nil, "only consider snapshots which include this (absolute) `path` for snapshot ID \"latest\"")
|
||||
}
|
||||
|
||||
func splitPath(path string) []string {
|
||||
d, f := filepath.Split(path)
|
||||
func splitPath(p string) []string {
|
||||
d, f := path.Split(p)
|
||||
if d == "" || d == "/" {
|
||||
return []string{f}
|
||||
}
|
||||
s := splitPath(filepath.Clean(d))
|
||||
s := splitPath(path.Clean(d))
|
||||
return append(s, f)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user