MCPcopy Create free account
hub / github.com/gogs/gogs / RetrieveRepoMetas

Function RetrieveRepoMetas

internal/route/repo/issue.go:277–295  ·  view source on GitHub ↗
(c *context.Context, repo *database.Repository)

Source from the content-addressed store, hash-verified

275}
276
277func RetrieveRepoMetas(c *context.Context, repo *database.Repository) []*database.Label {
278 if !c.Repo.IsWriter() {
279 return nil
280 }
281
282 labels, err := database.GetLabelsByRepoID(repo.ID)
283 if err != nil {
284 c.Error(err, "get labels by repository ID")
285 return nil
286 }
287 c.Data["Labels"] = labels
288
289 RetrieveRepoMilestonesAndAssignees(c, repo)
290 if c.Written() {
291 return nil
292 }
293
294 return labels
295}
296
297func getFileContentFromDefaultBranch(c *context.Context, filename string) (string, bool) {
298 if c.Repo.Commit == nil {

Callers 3

CompareAndPullRequestFunction · 0.85
NewIssueFunction · 0.85
ValidateRepoMetasFunction · 0.85

Calls 4

GetLabelsByRepoIDFunction · 0.92
IsWriterMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected