-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor the usage of batch catfile #31754
Conversation
015fd4a
to
7041756
Compare
…y git calls in openrepository
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is better to adjust the newly added logs, they are copy and paste, same logs from different places are not good for debug.
I will try to merge the two functions in following PRs |
When opening a repository, it will call `ensureValidRepository` and also `CatFileBatch`. But sometimes these will not be used until repository closed. So it's a waste of CPU to invoke 3 times git command for every open repository. This PR removed all of these from `OpenRepository` but only kept checking whether the folder exists. When a batch is necessary, the necessary functions will be invoked.
Backport #31754 by @lunny When opening a repository, it will call `ensureValidRepository` and also `CatFileBatch`. But sometimes these will not be used until repository closed. So it's a waste of CPU to invoke 3 times git command for every open repository. This PR removed all of these from `OpenRepository` but only kept checking whether the folder exists. When a batch is necessary, the necessary functions will be invoked. Co-authored-by: Lunny Xiao <[email protected]>
* giteaofficial/main: [skip ci] Updated translations via Crowdin Refactor the usage of batch catfile (go-gitea#31754) Fix agit automerge (go-gitea#31207)
When opening a repository, it will call
ensureValidRepository
and alsoCatFileBatch
. But sometimes these will not be used until repository closed. So it's a waste of CPU to invoke 3 times git command for every open repository.This PR removed all of these from
OpenRepository
but only kept checking whether the folder exists. When a batch is necessary, the necessary functions will be invoked.