mirror of
https://github.com/octoleo/restic.git
synced 2025-02-03 04:18:26 +00:00
Merge pull request 2082 from restic/fix-2079
dump: Use path instead of filepath
This commit is contained in:
commit
987ef2f4a9
@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/restic/restic/internal/debug"
|
"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\"")
|
flags.StringArrayVar(&dumpOptions.Paths, "path", nil, "only consider snapshots which include this (absolute) `path` for snapshot ID \"latest\"")
|
||||||
}
|
}
|
||||||
|
|
||||||
func splitPath(path string) []string {
|
func splitPath(p string) []string {
|
||||||
d, f := filepath.Split(path)
|
d, f := path.Split(p)
|
||||||
if d == "" || d == "/" {
|
if d == "" || d == "/" {
|
||||||
return []string{f}
|
return []string{f}
|
||||||
}
|
}
|
||||||
s := splitPath(filepath.Clean(d))
|
s := splitPath(path.Clean(d))
|
||||||
return append(s, f)
|
return append(s, f)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user