-
-
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
Remove git.Command.Run
and git.Command.RunInDir*
#19280
Conversation
# Conflicts: # modules/git/repo_tag.go
I think it's better to have some rename.
|
Do most people like to rename them now? And I think if we do so, we should also rename
|
And the name The longer names are friendly to be grep-ed out during refactoring. |
I don't think |
Hmmm, |
…s default timeout
I can not get a better name now. So how about:
If no objection, I will do it. |
I still think |
I pushed a demo for:
I think the |
@lunny a real example, when you read: err := cmd.Run(...)
_, _, err := cmd.RunString(...)
// then
if strings.Contains(err.Error(), "fatal: ...") {
} Do you know that these 2 errors are different? The second one contains So And I have designed a new error _, _, runErr := cmd.RunStdString(...);
if runErr != nil && runErr.Stderr() == "fatal: ..." { ... } Access the stderr directly, more handy and clear. |
Ack for rename ... |
Codecov Report
@@ Coverage Diff @@
## main #19280 +/- ##
=======================================
Coverage ? 47.40%
=======================================
Files ? 939
Lines ? 131080
Branches ? 0
=======================================
Hits ? 62134
Misses ? 61471
Partials ? 7475
Continue to review full report at Codecov.
|
* giteaoffical/main: Fix broken of team create (go-gitea#19288) Remove `git.Command.Run` and `git.Command.RunInDir*` (go-gitea#19280) Performance improvement for add team user when org has more than 1000 repositories (go-gitea#19227) [skip ci] Updated translations via Crowdin Update JS dependencies (go-gitea#19281) Fix container download counter (go-gitea#19287) go.mod: update kevinburke/ssh_config to v1.2.0 (go-gitea#19286) Fix global packages enabled avaiable (go-gitea#19276) Add Goroutine stack inspector to admin/monitor (go-gitea#19207) Move checks for pulls before merge into own function (go-gitea#19271) Restore user autoregistration with email addresses (go-gitea#19261) Improve sync performance for pull-mirrors (go-gitea#19125) Refactor `git.Command.Run*`, introduce `RunWithContextString` and `RunWithContextBytes` (go-gitea#19266) Move reaction to models/issues/ (go-gitea#19264)
Follows
git.Command.Run*
, introduceRunWithContextString
andRunWithContextBytes
#19266Close #18553
Now, only
RunWithContext
related functions.This PR is a simple search & replace:
stdout, err := RunInDir(path)
stdout, _, err := RunStdString(&git.RunOpts{Dir:path})