From 75c62ce5623fef5d9038048986f3cafb432a0026 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 13 Jan 2026 19:12:52 -0800 Subject: [PATCH] test --- modules/gitrepo/push.go | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/modules/gitrepo/push.go b/modules/gitrepo/push.go index a8945b5392..920c317f79 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) }