mirror of
https://github.com/octoleo/restic.git
synced 2024-12-22 10:58:55 +00:00
parent
67535e00a8
commit
f1f69bc648
7
changelog/unreleased/issue-1880
Normal file
7
changelog/unreleased/issue-1880
Normal file
@ -0,0 +1,7 @@
|
||||
Bugfix: Use `--cache-dir` argument for `check` command
|
||||
|
||||
`check` command now uses a specific cache directory if set using the `--cache-dir` argument.
|
||||
|
||||
The `--cache-dir` argument was not used by the `check` command, instead a cache directory was created in the temporary directory.
|
||||
|
||||
https://github.com/restic/restic/issues/1880
|
@ -122,6 +122,7 @@ func newReadProgress(gopts GlobalOptions, todo restic.Stat) *restic.Progress {
|
||||
// prepareCheckCache configures a special cache directory for check.
|
||||
//
|
||||
// * if --with-cache is specified, the default cache is used
|
||||
// * if the user provides --cache-dir, the specified directory is used
|
||||
// * if the user explicitly requested --no-cache, we don't use any cache
|
||||
// * by default, we use a cache in a temporary directory that is deleted after the check
|
||||
func prepareCheckCache(opts CheckOptions, gopts *GlobalOptions) (cleanup func()) {
|
||||
@ -131,6 +132,11 @@ func prepareCheckCache(opts CheckOptions, gopts *GlobalOptions) (cleanup func())
|
||||
return cleanup
|
||||
}
|
||||
|
||||
if gopts.CacheDir != "" {
|
||||
// use the specified cache directory, no setup needed
|
||||
return cleanup
|
||||
}
|
||||
|
||||
if gopts.NoCache {
|
||||
// don't use any cache, no setup needed
|
||||
return cleanup
|
||||
|
Loading…
Reference in New Issue
Block a user