diff --git a/cmd/restic/cmd_backup.go b/cmd/restic/cmd_backup.go index 6da6af333..413dd8862 100644 --- a/cmd/restic/cmd_backup.go +++ b/cmd/restic/cmd_backup.go @@ -427,7 +427,7 @@ func runBackup(opts BackupOptions, gopts GlobalOptions, args []string) error { var excludesByFile []RejectFunc for _, spec := range opts.ExcludeIfPresent { - f, err := excludeByFile(spec) + f, err := rejectIfPresent(spec) if err != nil { return err } diff --git a/cmd/restic/exclude.go b/cmd/restic/exclude.go index e8cb0daed..34d3971f1 100644 --- a/cmd/restic/exclude.go +++ b/cmd/restic/exclude.go @@ -17,12 +17,12 @@ import ( // should be excluded (rejected) from the backup. 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 // it resides in a directory with an exclusion file, that is specified by // excludeFileSpec in the form "filename[:content]". The returned error is // non-nil if the filename component of excludeFileSpec is empty. -func excludeByFile(excludeFileSpec string) (RejectFunc, error) { +func rejectIfPresent(excludeFileSpec string) (RejectFunc, error) { if excludeFileSpec == "" { return func(string, os.FileInfo) bool { return false }, nil }