diff options
author | 6543 <6543@obermui.de> | 2022-03-29 21:13:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-30 03:13:41 +0800 |
commit | 3e88af898a7b8e2697f7e4c3867c34b802d0b660 (patch) | |
tree | e8304867b9fd8d78ef0a3da7221d84fb29592c21 /routers/web/repo/pull.go | |
parent | 889a8c268ca6a54ff5be19e61b29b10feb4a12e8 (diff) | |
download | gitea-3e88af898a7b8e2697f7e4c3867c34b802d0b660.tar.gz gitea-3e88af898a7b8e2697f7e4c3867c34b802d0b660.zip |
Make git.OpenRepository accept Context (#19260)
* OpenRepositoryCtx -> OpenRepository
* OpenRepository -> openRepositoryWithDefaultContext, only for internal usage
Diffstat (limited to 'routers/web/repo/pull.go')
-rw-r--r-- | routers/web/repo/pull.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/routers/web/repo/pull.go b/routers/web/repo/pull.go index af99f1b275..7b24e5dabb 100644 --- a/routers/web/repo/pull.go +++ b/routers/web/repo/pull.go @@ -227,7 +227,7 @@ func ForkPost(ctx *context.Context) { } } - repo, err := repo_service.ForkRepository(ctx.Doer, ctxUser, repo_service.ForkRepoOptions{ + repo, err := repo_service.ForkRepository(ctx, ctx.Doer, ctxUser, repo_service.ForkRepoOptions{ BaseRepo: forkRepo, Name: form.RepoName, Description: form.Description, @@ -418,7 +418,7 @@ func PrepareViewPullInfo(ctx *context.Context, issue *models.Issue) *git.Compare if pull.BaseRepoID == ctx.Repo.Repository.ID && ctx.Repo.GitRepo != nil { baseGitRepo = ctx.Repo.GitRepo } else { - baseGitRepo, err := git.OpenRepositoryCtx(ctx, pull.BaseRepo.RepoPath()) + baseGitRepo, err := git.OpenRepository(ctx, pull.BaseRepo.RepoPath()) if err != nil { ctx.ServerError("OpenRepository", err) return nil @@ -470,7 +470,7 @@ func PrepareViewPullInfo(ctx *context.Context, issue *models.Issue) *git.Compare var headBranchSha string // HeadRepo may be missing if pull.HeadRepo != nil { - headGitRepo, err := git.OpenRepositoryCtx(ctx, pull.HeadRepo.RepoPath()) + headGitRepo, err := git.OpenRepository(ctx, pull.HeadRepo.RepoPath()) if err != nil { ctx.ServerError("OpenRepository", err) return nil @@ -1070,7 +1070,7 @@ func MergePullRequest(ctx *context.Context) { if ctx.Repo != nil && ctx.Repo.Repository != nil && pr.HeadRepoID == ctx.Repo.Repository.ID && ctx.Repo.GitRepo != nil { headRepo = ctx.Repo.GitRepo } else { - headRepo, err = git.OpenRepositoryCtx(ctx, pr.HeadRepo.RepoPath()) + headRepo, err = git.OpenRepository(ctx, pr.HeadRepo.RepoPath()) if err != nil { ctx.ServerError(fmt.Sprintf("OpenRepository[%s]", pr.HeadRepo.RepoPath()), err) return @@ -1280,7 +1280,7 @@ func CleanUpPullRequest(ctx *context.Context) { gitBaseRepo = ctx.Repo.GitRepo } else { // If not just open it - gitBaseRepo, err = git.OpenRepositoryCtx(ctx, pr.BaseRepo.RepoPath()) + gitBaseRepo, err = git.OpenRepository(ctx, pr.BaseRepo.RepoPath()) if err != nil { ctx.ServerError(fmt.Sprintf("OpenRepository[%s]", pr.BaseRepo.RepoPath()), err) return @@ -1295,7 +1295,7 @@ func CleanUpPullRequest(ctx *context.Context) { gitRepo = ctx.Repo.GitRepo } else if pr.BaseRepoID != pr.HeadRepoID { // Otherwise just load it up - gitRepo, err = git.OpenRepositoryCtx(ctx, pr.HeadRepo.RepoPath()) + gitRepo, err = git.OpenRepository(ctx, pr.HeadRepo.RepoPath()) if err != nil { ctx.ServerError(fmt.Sprintf("OpenRepository[%s]", pr.HeadRepo.RepoPath()), err) return |