mirror of
https://github.com/restic/restic.git
synced 2024-12-23 00:07:25 +00:00
backend: remove unused Paths variable
This commit is contained in:
parent
4ccd5e806b
commit
8c18c65b3b
2 changed files with 2 additions and 21 deletions
|
@ -2,25 +2,6 @@ package backend
|
||||||
|
|
||||||
import "os"
|
import "os"
|
||||||
|
|
||||||
// Paths contains the default paths for file-based backends (e.g. local).
|
|
||||||
var Paths = struct {
|
|
||||||
Data string
|
|
||||||
Snapshots string
|
|
||||||
Index string
|
|
||||||
Locks string
|
|
||||||
Keys string
|
|
||||||
Temp string
|
|
||||||
Config string
|
|
||||||
}{
|
|
||||||
"data",
|
|
||||||
"snapshots",
|
|
||||||
"index",
|
|
||||||
"locks",
|
|
||||||
"keys",
|
|
||||||
"tmp",
|
|
||||||
"config",
|
|
||||||
}
|
|
||||||
|
|
||||||
type Modes struct {
|
type Modes struct {
|
||||||
Dir os.FileMode
|
Dir os.FileMode
|
||||||
File os.FileMode
|
File os.FileMode
|
||||||
|
|
|
@ -152,7 +152,7 @@ func open(ctx context.Context, sftp *SFTP, cfg Config) (*SFTP, error) {
|
||||||
|
|
||||||
debug.Log("layout: %v\n", sftp.Layout)
|
debug.Log("layout: %v\n", sftp.Layout)
|
||||||
|
|
||||||
fi, err := sftp.c.Stat(Join(cfg.Path, backend.Paths.Config))
|
fi, err := sftp.c.Stat(sftp.Layout.Filename(restic.Handle{Type: restic.ConfigFile}))
|
||||||
m := backend.DeriveModesFromFileInfo(fi, err)
|
m := backend.DeriveModesFromFileInfo(fi, err)
|
||||||
debug.Log("using (%03O file, %03O dir) permissions", m.File, m.Dir)
|
debug.Log("using (%03O file, %03O dir) permissions", m.File, m.Dir)
|
||||||
|
|
||||||
|
@ -252,7 +252,7 @@ func Create(ctx context.Context, cfg Config) (*SFTP, error) {
|
||||||
sftp.Modes = backend.DefaultModes
|
sftp.Modes = backend.DefaultModes
|
||||||
|
|
||||||
// test if config file already exists
|
// test if config file already exists
|
||||||
_, err = sftp.c.Lstat(Join(cfg.Path, backend.Paths.Config))
|
_, err = sftp.c.Lstat(sftp.Layout.Filename(restic.Handle{Type: restic.ConfigFile}))
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return nil, errors.New("config file already exists")
|
return nil, errors.New("config file already exists")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue