mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-05-12 22:10:25 +00:00
Update module github.com/golangci/golangci-lint/v2/cmd/golangci-lint to v2.6.1 (forgejo) (#10053)
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/10053 Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org> Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
This commit is contained in:
parent
b387a1ce4a
commit
b29641a357
5 changed files with 10 additions and 36 deletions
|
|
@ -73,31 +73,3 @@ func RepositoryFromContextOrOpen(ctx context.Context, repo Repository) (*git.Rep
|
|||
gitRepo, err := OpenRepository(ctx, repo)
|
||||
return gitRepo, gitRepo, err
|
||||
}
|
||||
|
||||
// repositoryFromContextPath attempts to get the repository from the context
|
||||
func repositoryFromContextPath(ctx context.Context, path string) *git.Repository {
|
||||
value := ctx.Value(RepositoryContextKey)
|
||||
if value == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
if repo, ok := value.(*git.Repository); ok && repo != nil {
|
||||
if repo.Path == path {
|
||||
return repo
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RepositoryFromContextOrOpenPath attempts to get the repository from the context or just opens it
|
||||
// Deprecated: Use RepositoryFromContextOrOpen instead
|
||||
func RepositoryFromContextOrOpenPath(ctx context.Context, path string) (*git.Repository, io.Closer, error) {
|
||||
gitRepo := repositoryFromContextPath(ctx, path)
|
||||
if gitRepo != nil {
|
||||
return gitRepo, nopCloser(nil), nil
|
||||
}
|
||||
|
||||
gitRepo, err := git.OpenRepository(ctx, path)
|
||||
return gitRepo, gitRepo, err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ type Team struct {
|
|||
// enum: ["none", "read", "write", "admin", "owner"]
|
||||
Permission string `json:"permission"`
|
||||
// example: ["repo.code","repo.issues","repo.ext_issues","repo.wiki","repo.pulls","repo.releases","repo.projects","repo.ext_wiki"]
|
||||
//
|
||||
// Deprecated: This variable should be replaced by UnitsMap and will be dropped in later versions.
|
||||
Units []string `json:"units"`
|
||||
// example: {"repo.code":"read","repo.issues":"write","repo.ext_issues":"none","repo.wiki":"admin","repo.pulls":"owner","repo.releases":"none","repo.projects":"none","repo.ext_wiki":"none"}
|
||||
|
|
@ -30,6 +31,7 @@ type CreateTeamOption struct {
|
|||
// enum: ["read", "write", "admin"]
|
||||
Permission string `json:"permission"`
|
||||
// example: ["repo.actions","repo.code","repo.issues","repo.ext_issues","repo.wiki","repo.ext_wiki","repo.pulls","repo.releases","repo.projects","repo.ext_wiki"]
|
||||
//
|
||||
// Deprecated: This variable should be replaced by UnitsMap and will be dropped in later versions.
|
||||
Units []string `json:"units"`
|
||||
// example: {"repo.actions","repo.packages","repo.code":"read","repo.issues":"write","repo.ext_issues":"none","repo.wiki":"admin","repo.pulls":"owner","repo.releases":"none","repo.projects":"none","repo.ext_wiki":"none"}
|
||||
|
|
@ -46,6 +48,7 @@ type EditTeamOption struct {
|
|||
// enum: ["read", "write", "admin"]
|
||||
Permission string `json:"permission"`
|
||||
// example: ["repo.code","repo.issues","repo.ext_issues","repo.wiki","repo.pulls","repo.releases","repo.projects","repo.ext_wiki"]
|
||||
//
|
||||
// Deprecated: This variable should be replaced by UnitsMap and will be dropped in later versions.
|
||||
Units []string `json:"units"`
|
||||
// example: {"repo.code":"read","repo.issues":"write","repo.ext_issues":"none","repo.wiki":"admin","repo.pulls":"owner","repo.releases":"none","repo.projects":"none","repo.ext_wiki":"none"}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue