diff --git a/modules/gitrepo/push.go b/modules/gitrepo/push.go index a8945b53924..920c317f796 100644 --- a/modules/gitrepo/push.go +++ b/modules/gitrepo/push.go @@ -7,7 +7,6 @@ import ( "context" "code.gitea.io/gitea/modules/git" - "code.gitea.io/gitea/modules/globallock" ) // PushToExternal pushes a managed repository to an external remote. @@ -17,16 +16,12 @@ func PushToExternal(ctx context.Context, repo Repository, opts git.PushOptions) // Push pushes from one managed repository to another managed repository. func Push(ctx context.Context, fromRepo, toRepo Repository, opts git.PushOptions) error { - return globallock.LockAndDo(ctx, getRepoWriteLockKey(toRepo.RelativePath()), func(ctx context.Context) error { - opts.Remote = repoPath(toRepo) - return git.Push(ctx, repoPath(fromRepo), opts) - }) + opts.Remote = repoPath(toRepo) + return git.Push(ctx, repoPath(fromRepo), opts) } // PushFromLocal pushes from a local path to a managed repository. func PushFromLocal(ctx context.Context, fromLocalPath string, toRepo Repository, opts git.PushOptions) error { - return globallock.LockAndDo(ctx, getRepoWriteLockKey(toRepo.RelativePath()), func(ctx context.Context) error { - opts.Remote = repoPath(toRepo) - return git.Push(ctx, fromLocalPath, opts) - }) + opts.Remote = repoPath(toRepo) + return git.Push(ctx, fromLocalPath, opts) }