forked from gitea/gitea
1
0
Fork 0

Avoid MoreThanOne Error (#19557) (#19591)

Backport #19557
This commit is contained in:
99rgosse 2022-05-03 14:36:58 +02:00 committed by GitHub
parent 82f24bedc2
commit 6eb3c05cb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -35,7 +35,7 @@ func CreateNewBranch(doer *user_model.User, repo *repo_model.Repository, oldBran
if err := git.Push(git.DefaultContext, repo.RepoPath(), git.PushOptions{ if err := git.Push(git.DefaultContext, repo.RepoPath(), git.PushOptions{
Remote: repo.RepoPath(), Remote: repo.RepoPath(),
Branch: fmt.Sprintf("%s:%s%s", oldBranchName, git.BranchPrefix, branchName), Branch: fmt.Sprintf("%s%s:%s%s", git.BranchPrefix, oldBranchName, git.BranchPrefix, branchName),
Env: models.PushingEnvironment(doer, repo), Env: models.PushingEnvironment(doer, repo),
}); err != nil { }); err != nil {
if git.IsErrPushOutOfDate(err) || git.IsErrPushRejected(err) { if git.IsErrPushOutOfDate(err) || git.IsErrPushRejected(err) {