mirror of
https://github.com/go-gitea/gitea
synced 2025-07-13 14:07:20 +00:00
RepoAssignment ensure to close before overwrite (#19449)
* check if GitRepo already open and close if * only run RepoAssignment once * refactor context helper for api to open GitRepo
This commit is contained in:
@ -45,7 +45,8 @@ func GetBlob(ctx *context.APIContext) {
|
||||
ctx.Error(http.StatusBadRequest, "", "sha not provided")
|
||||
return
|
||||
}
|
||||
if blob, err := files_service.GetBlobBySHA(ctx, ctx.Repo.Repository, sha); err != nil {
|
||||
|
||||
if blob, err := files_service.GetBlobBySHA(ctx, ctx.Repo.Repository, ctx.Repo.GitRepo, sha); err != nil {
|
||||
ctx.Error(http.StatusBadRequest, "", err)
|
||||
} else {
|
||||
ctx.JSON(http.StatusOK, blob)
|
||||
|
Reference in New Issue
Block a user