-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Pre-calculate the absolute path of git #6575
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6575 +/- ##
==========================================
+ Coverage 40.76% 40.77% +<.01%
==========================================
Files 407 407
Lines 54730 54735 +5
==========================================
+ Hits 22310 22317 +7
+ Misses 29366 29362 -4
- Partials 3054 3056 +2
Continue to review full report at Codecov.
|
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 found this solution quite simple for the user/admin and for others calls to git we just have to update call to "git" to GitExecutable in order to optimise them. Or we can even migrate them to NewCommand.
Some could easily be found :
Line 124 in 704da08
if _, err := exec.LookPath("git"); err != nil { Line 142 in 704da08
if stdout, stderr, err := process.GetManager().Exec("NewRepoContext(get setting)", "git", "config", "--get", configKey); err != nil || strings.TrimSpace(stdout) == "" { gitea/modules/uploader/repo.go
Line 131 in 296814e
cmd := exec.CommandContext(ctx, "git", cmdArgs...) - ...
For more : https://github.com/go-gitea/gitea/search?l=Go&q=git+Exec
@sapk Yes, we should move all the git commands to |
In #6505 I'm moving a lot of the git calls to |
Also make it flexible to accept customized/user-defined value.
Related to #6386
Avoid the overhead of searching large PATH.