forgejo/modules/doctor
zeripath 9dc53ba65f
Prevent panic in doctor command when running default checks (#21791) (#21808)
Backport #21791

There was a bug introduced in #21352 due to a change of behaviour caused
by #19280. This causes a panic on running the default doctor checks
because the panic introduced by #19280 assumes that the only way
opts.StdOut and opts.Stderr can be set in RunOpts is deliberately.
Unfortunately, when running a git.Command the provided RunOpts can be
set, therefore if you share a common set of RunOpts these two values can
be set by the previous commands.

This PR stops using common RunOpts for the commands in that doctor check
but secondly stops RunCommand variants from changing the provided
RunOpts.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2022-11-13 22:43:40 +00:00
..
authorizedkeys.go Move almost all functions' parameter db.Engine to context.Context (#19748) 2022-05-20 22:08:52 +08:00
breaking.go Add username check to doctor (#20140) (#20671) 2022-08-04 11:07:07 -05:00
checkOldArchives.go Use ctx instead of db.DefaultContext in some packages(routers/services/modules) (#19163) 2022-03-22 16:22:54 +01:00
dbconsistency.go Backtick table name in generic orphan check (#20019) (#20037) 2022-06-19 19:41:12 +01:00
dbversion.go Propagate context and ensure git commands run in request context (#17868) 2022-01-19 23:26:57 +00:00
doctor.go Fix git.Init for doctor sub-command (#20782) (#20783) 2022-08-14 00:32:44 +08:00
fix16961.go Fix inconsistency in doctor output (#19836) 2022-05-31 14:49:40 -04:00
fix16961_test.go Move repository model into models/repo (#17933) 2021-12-10 09:27:50 +08:00
heads.go Prevent panic in doctor command when running default checks (#21791) (#21808) 2022-11-13 22:43:40 +00:00
mergebase.go Move issues related files into models/issues (#19931) 2022-06-13 17:37:59 +08:00
misc.go [doctor] do not update User Stars numbers unless --fix (#19750) 2022-05-19 15:46:56 +02:00
paths.go format with gofumpt (#18184) 2022-01-20 18:46:10 +01:00
storage.go Propagate context and ensure git commands run in request context (#17868) 2022-01-19 23:26:57 +00:00
usertype.go Propagate context and ensure git commands run in request context (#17868) 2022-01-19 23:26:57 +00:00