mirror of
https://github.com/octoleo/restic.git
synced 2024-11-22 12:55:18 +00:00
backup: don't pretend to lock repo for dry run
The dry run did not actually create lock files, but still ran all other parts of the lock processing.
This commit is contained in:
parent
f490288738
commit
05e5e29a8c
@ -506,10 +506,13 @@ func runBackup(ctx context.Context, opts BackupOptions, gopts GlobalOptions, ter
|
|||||||
if !gopts.JSON {
|
if !gopts.JSON {
|
||||||
progressPrinter.V("lock repository")
|
progressPrinter.V("lock repository")
|
||||||
}
|
}
|
||||||
lock, ctx, err := lockRepo(ctx, repo, gopts.RetryLock, gopts.JSON)
|
if !opts.DryRun {
|
||||||
defer unlockRepo(lock)
|
var lock *restic.Lock
|
||||||
if err != nil {
|
lock, ctx, err = lockRepo(ctx, repo, gopts.RetryLock, gopts.JSON)
|
||||||
return err
|
defer unlockRepo(lock)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// rejectByNameFuncs collect functions that can reject items from the backup based on path only
|
// rejectByNameFuncs collect functions that can reject items from the backup based on path only
|
||||||
|
Loading…
Reference in New Issue
Block a user