mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-29 10:57:44 +09:00 
			
		
		
		
	Make git.OpenRepository accept Context (#19260)
* OpenRepositoryCtx -> OpenRepository * OpenRepository -> openRepositoryWithDefaultContext, only for internal usage
This commit is contained in:
		| @@ -529,7 +529,7 @@ func RepoAssignment(ctx *Context) (cancel context.CancelFunc) { | ||||
| 	} | ||||
| 	ctx.Data["CanSignedUserFork"] = canSignedUserFork | ||||
|  | ||||
| 	userAndOrgForks, err := models.GetForksByUserAndOrgs(ctx.Doer, ctx.Repo.Repository) | ||||
| 	userAndOrgForks, err := models.GetForksByUserAndOrgs(ctx, ctx.Doer, ctx.Repo.Repository) | ||||
| 	if err != nil { | ||||
| 		ctx.ServerError("GetForksByUserAndOrgs", err) | ||||
| 		return | ||||
| @@ -588,7 +588,7 @@ func RepoAssignment(ctx *Context) (cancel context.CancelFunc) { | ||||
| 		return | ||||
| 	} | ||||
|  | ||||
| 	gitRepo, err := git.OpenRepositoryCtx(ctx, repo_model.RepoPath(userName, repoName)) | ||||
| 	gitRepo, err := git.OpenRepository(ctx, repo_model.RepoPath(userName, repoName)) | ||||
| 	if err != nil { | ||||
| 		if strings.Contains(err.Error(), "repository does not exist") || strings.Contains(err.Error(), "no such file or directory") { | ||||
| 			log.Error("Repository %-v has a broken repository on the file system: %s Error: %v", ctx.Repo.Repository, ctx.Repo.Repository.RepoPath(), err) | ||||
| @@ -846,7 +846,7 @@ func RepoRefByType(refType RepoRefType, ignoreNotExistErr ...bool) func(*Context | ||||
|  | ||||
| 		if ctx.Repo.GitRepo == nil { | ||||
| 			repoPath := repo_model.RepoPath(ctx.Repo.Owner.Name, ctx.Repo.Repository.Name) | ||||
| 			ctx.Repo.GitRepo, err = git.OpenRepositoryCtx(ctx, repoPath) | ||||
| 			ctx.Repo.GitRepo, err = git.OpenRepository(ctx, repoPath) | ||||
| 			if err != nil { | ||||
| 				ctx.ServerError("RepoRef Invalid repo "+repoPath, err) | ||||
| 				return | ||||
|   | ||||
		Reference in New Issue
	
	Block a user