1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-10 19:48:19 +00:00

Fix incorrect CLI exit code and duplicate error message (#26346) (#26347)

Backport #26346

Follow the CLI refactoring, and add tests.
This commit is contained in:
wxiaoguang
2023-08-05 23:37:04 +08:00
committed by GitHub
parent 8a97cdd91b
commit fa431b377d
4 changed files with 104 additions and 4 deletions

View File

@@ -16,3 +16,9 @@ func RedirectURL(resp http.ResponseWriter) string {
func IsNormalPageCompleted(s string) bool {
return strings.Contains(s, `<footer class="page-footer"`) && strings.Contains(s, `</html>`)
}
func MockVariableValue[T any](p *T, v T) (reset func()) {
old := *p
*p = v
return func() { *p = old }
}