Print warning when unlocking the repo fails

This commit is contained in:
Alexander Neumann 2020-11-28 11:31:25 +01:00
parent 666768cd17
commit a3105799c9
1 changed files with 7 additions and 2 deletions

View File

@ -44,11 +44,16 @@ func runCat(gopts GlobalOptions, args []string) error {
if !gopts.NoLock {
lock, err := lockRepo(gopts.ctx, repo)
// Make the linter happy
if err != nil {
return err
}
defer func() { _ = unlockRepo(lock) }()
defer func() {
err := unlockRepo(lock)
if err != nil {
Warnf("unlock repo failed: %v", err)
}
}()
}
tpe := args[0]