jesseduffield / lazygit

simple terminal UI for git commands
MIT License
51.38k stars 1.8k forks source link

Improve branch and reflog loading when sorting branches by date #3609

Closed stefanhaller closed 4 months ago

stefanhaller commented 4 months ago

When branches are sorted by recency we have this logic that first loads the branches so that they can be rendered quickly; in parallel, it starts loading the reflog in the background, and when that's done, it loads the branches again so that they get their recency values. This means that branches are loaded twice at startup.

We don't need this logic when branches are not sorted by recency, so we can simply load branches and reflog in parallel like everything else.

This shouldn't change any user observable behavior, it just avoids doing unnecessary work at startup.

codacy-production[bot] commented 4 months ago

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 51eb6d7c7d74a90387abac2033ab7af428492ad9[^1] :white_check_mark: 100.00%
Coverage variation details | | Coverable lines | Covered lines | Coverage | | ------------- | ------------- | ------------- | ------------- | | Common ancestor commit (51eb6d7c7d74a90387abac2033ab7af428492ad9) | Report Missing | Report Missing | Report Missing | | | Head commit (35af886f554c85d978213fa3f7c735dc25d651ac) | 51252 | 43170 | 84.23% | **Coverage variation** is the difference between the coverage for the head and common ancestor commits of the pull request branch: ` - `
Diff coverage details | | Coverable lines | Covered lines | Diff coverage | | ------------- | ------------- | ------------- | ------------- | | Pull request (#3609) | 5 | 5 | **100.00%** | **Diff coverage** is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: `/ * 100%`

See your quality gate settings    Change summary preferences

Codacy will stop sending the deprecated coverage status from June 5th, 2024. Learn more [^1]: Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.