mirror of
https://github.com/restic/restic.git
synced 2025-06-12 20:38:28 +00:00
Rename excludeByFile -> rejectIfPresent
This commit is contained in:
parent
a9c705009c
commit
4a0129fc2b
@ -427,7 +427,7 @@ func runBackup(opts BackupOptions, gopts GlobalOptions, args []string) error {
|
|||||||
|
|
||||||
var excludesByFile []RejectFunc
|
var excludesByFile []RejectFunc
|
||||||
for _, spec := range opts.ExcludeIfPresent {
|
for _, spec := range opts.ExcludeIfPresent {
|
||||||
f, err := excludeByFile(spec)
|
f, err := rejectIfPresent(spec)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -17,12 +17,12 @@ import (
|
|||||||
// should be excluded (rejected) from the backup.
|
// should be excluded (rejected) from the backup.
|
||||||
type RejectFunc func(filename string, fi os.FileInfo) bool
|
type RejectFunc func(filename string, fi os.FileInfo) bool
|
||||||
|
|
||||||
// excludeByFile returns a RejectFunc which itself returns whether a path
|
// rejectIfPresent returns a RejectFunc which itself returns whether a path
|
||||||
// should be excluded. The RejectFunc considers a file to be excluded when
|
// should be excluded. The RejectFunc considers a file to be excluded when
|
||||||
// it resides in a directory with an exclusion file, that is specified by
|
// it resides in a directory with an exclusion file, that is specified by
|
||||||
// excludeFileSpec in the form "filename[:content]". The returned error is
|
// excludeFileSpec in the form "filename[:content]". The returned error is
|
||||||
// non-nil if the filename component of excludeFileSpec is empty.
|
// non-nil if the filename component of excludeFileSpec is empty.
|
||||||
func excludeByFile(excludeFileSpec string) (RejectFunc, error) {
|
func rejectIfPresent(excludeFileSpec string) (RejectFunc, error) {
|
||||||
if excludeFileSpec == "" {
|
if excludeFileSpec == "" {
|
||||||
return func(string, os.FileInfo) bool { return false }, nil
|
return func(string, os.FileInfo) bool { return false }, nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user