mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-04 13:50:39 +00:00
Move some helper files out of models (#19355)
* Move some helper files out of models * Some improvements Co-authored-by: delvh <dev.lh@web.de>
This commit is contained in:
parent
d4834071da
commit
4ca1d7547a
23 changed files with 108 additions and 107 deletions
|
@ -36,7 +36,7 @@ func CreateNewBranch(ctx context.Context, doer *user_model.User, repo *repo_mode
|
|||
if err := git.Push(ctx, repo.RepoPath(), git.PushOptions{
|
||||
Remote: repo.RepoPath(),
|
||||
Branch: fmt.Sprintf("%s%s:%s%s", git.BranchPrefix, oldBranchName, git.BranchPrefix, branchName),
|
||||
Env: models.PushingEnvironment(doer, repo),
|
||||
Env: repo_module.PushingEnvironment(doer, repo),
|
||||
}); err != nil {
|
||||
if git.IsErrPushOutOfDate(err) || git.IsErrPushRejected(err) {
|
||||
return err
|
||||
|
@ -93,7 +93,7 @@ func CreateNewBranchFromCommit(ctx context.Context, doer *user_model.User, repo
|
|||
if err := git.Push(ctx, repo.RepoPath(), git.PushOptions{
|
||||
Remote: repo.RepoPath(),
|
||||
Branch: fmt.Sprintf("%s:%s%s", commit, git.BranchPrefix, branchName),
|
||||
Env: models.PushingEnvironment(doer, repo),
|
||||
Env: repo_module.PushingEnvironment(doer, repo),
|
||||
}); err != nil {
|
||||
if git.IsErrPushOutOfDate(err) || git.IsErrPushRejected(err) {
|
||||
return err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue