From c3538b063aa82bdcec009fbd4f937a3d41fef992 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Sun, 14 Nov 2021 16:32:03 +0100 Subject: [PATCH] lock: Use repository interface instead of struct --- cmd/restic/lock.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cmd/restic/lock.go b/cmd/restic/lock.go index 188bb1d59..03d880670 100644 --- a/cmd/restic/lock.go +++ b/cmd/restic/lock.go @@ -7,7 +7,6 @@ import ( "github.com/restic/restic/internal/debug" "github.com/restic/restic/internal/errors" - "github.com/restic/restic/internal/repository" "github.com/restic/restic/internal/restic" ) @@ -22,17 +21,17 @@ var globalLocks struct { sync.Once } -func lockRepo(ctx context.Context, repo *repository.Repository) (*restic.Lock, context.Context, error) { +func lockRepo(ctx context.Context, repo restic.Repository) (*restic.Lock, context.Context, error) { return lockRepository(ctx, repo, false) } -func lockRepoExclusive(ctx context.Context, repo *repository.Repository) (*restic.Lock, context.Context, error) { +func lockRepoExclusive(ctx context.Context, repo restic.Repository) (*restic.Lock, context.Context, error) { return lockRepository(ctx, repo, true) } // lockRepository wraps the ctx such that it is cancelled when the repository is unlocked // cancelling the original context also stops the lock refresh -func lockRepository(ctx context.Context, repo *repository.Repository, exclusive bool) (*restic.Lock, context.Context, error) { +func lockRepository(ctx context.Context, repo restic.Repository, exclusive bool) (*restic.Lock, context.Context, error) { // make sure that a repository is unlocked properly and after cancel() was // called by the cleanup handler in global.go globalLocks.Do(func() {