Unnecessary refresh when staying on the same label and are not supposed to refresh #2884
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We noticed that each access could take about 1 second on a really huge repository (20,000 commits) with one branch.
This was tracked down to JGitEnvironmentRepository that would do a checkout and merge even if the requested label is always the same and we are inside the refresh rate so no pull occured.
The PR skips the checkout and merge when no pull is done and the same label is requested because we know the repo is already at the right place.
I also did 2-3 improvements to the code.
The content of
previousLabel
relies on the correct synchronization from the outside. Moving it to volatile would remove this requirement. That said, if #2656 is merged, it will remove that need I think.I added myself as an author in the files I'm changed a lot. Feel free to remove me if the change is not substantial enough. I was only trying to follow the contributing guidelines.