fix: [CODE-3120]: reload repo in repo summary API controller (#3356)

* reload repo in repo summary API controller
This commit is contained in:
Marko Gaćeša 2025-01-30 16:09:55 +00:00 committed by Harness
parent 16e2ec6660
commit 6f37eaea3f

View File

@ -35,6 +35,12 @@ func (c *Controller) Summary(
return nil, fmt.Errorf("access check failed: %w", err)
}
// fetch the repo because the one we have probably comes from the cache.
repo, err = c.repoStore.Find(ctx, repo.ID)
if err != nil {
return nil, fmt.Errorf("failed to get the repo: %w", err)
}
summary, err := c.git.Summary(ctx, git.SummaryParams{ReadParams: git.CreateReadParams(repo)})
if err != nil {
return nil, fmt.Errorf("failed to get repo summary: %w", err)