mirror of
https://github.com/go-gitea/gitea.git
synced 2026-05-21 08:50:51 +02:00
test
This commit is contained in:
parent
e4a568141b
commit
75c62ce562
@ -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)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user