Remove calls to Rugged::BranchCollection#each from extracts_path before_action

Merged Paco Guzman requested to merge 18709-reduce-git-calls into master

What does this MR do?

Check for git data first on the cache later on git.

Why was this MR needed?

Remove Git data noise on dashboard to keep focusing on reducing those calls. This MR does not close original issue but I think is going to give us a better insight in what is happening.

What are the relevant issue numbers?

#18709 (closed)

Does this MR meet the acceptance criteria?