restic: speed up repository config initialization in tests

Avoid redundant polynomial generation, which takes a millisecond or so.
This commit is contained in:
Michael Eischer committed 2026-06-20 19:46:22 +02:00
1 parent 440d925467
commit 1174e97b30
3 files changed
+10 -9

No files matched your search

+1 -4
View File
@@ -919,13 +919,10 @@ func (r *Repository) Init(ctx context.Context, version uint, password string, ch
return err
}
cfg, err := restic.CreateConfig(version)
cfg, err := restic.CreateConfig(version, chunkerPolynomial)
if err != nil {
return err
}
if chunkerPolynomial != nil {
cfg.ChunkerPolynomial = *chunkerPolynomial
}
return r.init(ctx, password, cfg)
}