RevGrid: Lazy handling for current branch #9885
Merged
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.
Followup to #9864
Proposed changes
Avoid Git calls where no branch is checked out and in submodules
This is similar to how HEAD is cached in CurrentCheckout.
For repos where a Git branch is checked out, this is handled by reading files, so some IO is needed.
This adds some ms here and there, nothing critical (but affecting performance a lot more than most programming constructs).
For submodules where normally no branch is checked out, this requires Git commands, both when loading revisions and opening menues etc.
Screenshots
No UI changed, just some commands (only startup shown).
Before
After
Test methodology
manual
Removed an incorrect test and adopted another.
(A branch name like
(test)
is actually legal and should be displayed as((test))
in the title.Merge strategy
I agree that the maintainer squash merge this PR (if the commit message is clear).
✒️ I contribute this code under The Developer Certificate of Origin.