refactor: use RunWithStderr for git commands (#40295)

If the stderr output is not handled, then it needs to use RunWithStderr
to make sure the git error message is included in the returned error.
Otherwise, when the git command fails, the error log won't show useful
information.

Ref:

* #39795 : no useful information in log messages
*
https://github.com/go-gitea/gitea/pull/40160#pullrequestreview-5752720866
This commit is contained in:
wxiaoguang
2026-11-09 17:59:52 +00:00
committed by GitHub
parent e0b2f3425e
commit 772f365254
26 changed files with 57 additions and 47 deletions

View File

@@ -92,6 +92,8 @@ conditional `UPDATE` or a lock.
- Pass already opened repositories down or use `git.RepositoryFromContextOrOpen`
rather than reopening them or spawning extra `git` processes.
- If git command stderr output is not handled by the caller, then it needs to use RunWithStderr
to make sure the git error message is included in the returned error and displayed in the logs.
## Dependencies