repository: expose cache via method

This commit is contained in:
Michael Eischer
2025-01-13 22:40:18 +01:00
parent 99e105eeb6
commit b7ff8ea9cd
6 changed files with 21 additions and 17 deletions
+2 -2
View File
@@ -11,12 +11,12 @@ import (
// rejectResticCache returns a RejectByNameFunc that rejects the restic cache
// directory (if set).
func rejectResticCache(repo *repository.Repository) (archiver.RejectByNameFunc, error) {
if repo.Cache == nil {
if repo.Cache() == nil {
return func(string) bool {
return false
}, nil
}
cacheBase := repo.Cache.BaseDir()
cacheBase := repo.Cache().BaseDir()
if cacheBase == "" {
return nil, errors.New("cacheBase is empty string")