2
2
mirror of https://github.com/octoleo/restic.git synced 2024-05-30 23:50:48 +00:00
Commit Graph

17 Commits

Author SHA1 Message Date
Michael Eischer
d72181c8c1 Ensure that the lock cleanup handler is run after the global one
cleanup handlers run in the order in which they are added. As Go calls
init() functions in lexical order, the cleanup handler from global.go
was registered before that from lock.go, which is the correct order.

Make this order explicit to ensure that this won't break accidentally.
2022-02-12 20:21:58 +01:00
greatroar
dec5008369 Warn when unlock fails instead of returning an error
Only one caller was checking the error.
2020-12-29 17:48:20 +01:00
Michael Eischer
2964d2ad15 Skip unlocking for nil locks
Now that lockRepo receives a context, it is possible that it is canceled
before a lock was created. Thus `unlockRepo` must be able to handle this
case.
2020-10-09 22:39:06 +02:00
Michael Eischer
0c9efa9c2a Pass context to lockRepo 2020-10-09 22:39:06 +02:00
Michael Eischer
182655bc88 Replace fmt.Printf/Println/Fprintf with wrapper functions
cmd/restic/globals.go already provides Printf, Println and Warnf wrapper
which get their output streams from the globalOptions object. This
allows for stream replacements when testing.
2020-06-14 11:08:11 +02:00
Michael Eischer
087c770161 Revive hint to the unlock command if a repository is locked
errors.Fatalf wraps a error and just keeps an error message as a string.
This prevents the `restic.IsAlreadyLocked(err)` check from working as
the error is no longer an ErrAlreadyLocked.

Just add an additional remark to the error using `errors.WithMessage`.
2020-06-10 20:58:56 +02:00
Alexander Neumann
7d59df1ab8 mount: Ignore non-existing locks
Closes #1637
2018-02-25 13:11:03 +01:00
Alexander Neumann
67193e3deb Improve error message when creating lock failed 2017-10-14 15:56:25 +02:00
Alexander Neumann
23c903074c Move restic package to internal/restic 2017-07-24 17:43:32 +02:00
Alexander Neumann
6caeff2408 Run goimports 2017-07-23 14:21:03 +02:00
Alexander Neumann
83d1a46526 Moves files 2017-07-23 14:19:13 +02:00
Alexander Neumann
b63399d606 Move things around for gb
This moves all restic source files to src/, and all vendored
dependencies to vendor/src.
2016-02-20 17:31:20 +01:00
Alexander Neumann
3cabadab43 Allow more than one cleanup handler 2015-07-19 18:13:27 +02:00
Alexander Neumann
159b9e80c4 cmd/restic: implement lock refresh 2015-07-12 22:10:01 +02:00
Alexander Neumann
281eea9c05 sftp: Use own process group for ssh subprocess 2015-07-05 11:07:10 +02:00
Alexander Neumann
e657287eac cmd/restic: Add command unlock, improve error message 2015-06-28 13:52:23 +02:00
Alexander Neumann
13e9a35f96 cmd/restic: Add lock handling, interrupt cleanup 2015-06-28 13:52:22 +02:00