Move get/set default branch from git package to gitrepo package to hide repopath (#29126)
This commit is contained in:
parent
a1f5dd7677
commit
25b842df26
15 changed files with 52 additions and 63 deletions
|
@ -375,7 +375,7 @@ func RenameBranch(ctx context.Context, repo *repo_model.Repository, doer *user_m
|
|||
log.Error("CancelRunningJobs: %v", err)
|
||||
}
|
||||
|
||||
err2 = gitRepo.SetDefaultBranch(to)
|
||||
err2 = gitrepo.SetDefaultBranch(ctx, repo, to)
|
||||
if err2 != nil {
|
||||
return err2
|
||||
}
|
||||
|
@ -540,7 +540,7 @@ func SetRepoDefaultBranch(ctx context.Context, repo *repo_model.Repository, gitR
|
|||
log.Error("CancelRunningJobs: %v", err)
|
||||
}
|
||||
|
||||
if err := gitRepo.SetDefaultBranch(newBranchName); err != nil {
|
||||
if err := gitrepo.SetDefaultBranch(ctx, repo, newBranchName); err != nil {
|
||||
if !git.IsErrUnsupportedVersion(err) {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue