mirror of
https://github.com/go-gitea/gitea.git
synced 2025-12-19 19:21:34 +00:00
Use gitrepo's clone and push when possible (#36093)
1 Move `IsRepositoryModelOrDirExist` and `CheckCreateRepository` to service layer 2 Use `gitrepo.Pushxxx` instead of `git.Push` when possible 3 use `gitrepo.Clonexxx` instead of `gitrepo.Clone` when possible
This commit is contained in:
@@ -385,8 +385,7 @@ func CreateNewBranchFromCommit(ctx context.Context, doer *user_model.User, repo
|
||||
return err
|
||||
}
|
||||
|
||||
if err := git.Push(ctx, repo.RepoPath(), git.PushOptions{
|
||||
Remote: repo.RepoPath(),
|
||||
if err := gitrepo.Push(ctx, repo, repo, git.PushOptions{
|
||||
Branch: fmt.Sprintf("%s:%s%s", commitID, git.BranchPrefix, branchName),
|
||||
Env: repo_module.PushingEnvironment(doer, repo),
|
||||
}); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user