Skip to content

Commit df66315

Browse files
committed
Merge branch 'master' into unprotected-files
# Conflicts: # models/migrations/migrations.go # models/migrations/v193.go
2 parents 2c743bd + 77f604a commit df66315

File tree

121 files changed

+4569
-866
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+4569
-866
lines changed

CHANGELOG.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,41 @@ This changelog goes through all the changes that have been made in each release
44
without substantial changes to our git log; to see the highlights of what has
55
been added to each release, please refer to the [blog](https://blog.gitea.io).
66

7+
## [1.15.2](https://github.com/go-gitea/gitea/releases/tag/v1.15.2) - 2021-09-03
8+
9+
* BUGFIXES
10+
* Add unique constraint back into issue_index (#16938)
11+
* Close storage objects before cleaning (#16934) (#16942)
12+
13+
## [1.15.1](https://github.com/go-gitea/gitea/releases/tag/v1.15.1) - 2021-09-02
14+
15+
* BUGFIXES
16+
* Allow BASIC authentication access to /:owner/:repo/releases/download/* (#16916) (#16923)
17+
* Prevent leave changes dialogs due to autofill fields (#16912) (#16920)
18+
* Ignore review comment when ref commit is missed (#16905) (#16919)
19+
* Fix wrong attachment removal (#16915) (#16917)
20+
* Gitlab Migrator: dont ignore reactions of last request (#16903) (#16913)
21+
* Correctly return the number of Repositories for Organizations (#16807) (#16911)
22+
* Test if LFS object is accessible (#16865) (#16904)
23+
* Fix git.Blob.DataAsync(): close pipe since we return a NopCloser (#16899) (#16900)
24+
* Fix dump and restore respository (#16698) (#16898)
25+
* Repare and Improve GetDiffRangeWithWhitespaceBehavior (#16894) (#16895)
26+
* Fix wiki raw commit diff/patch view (#16891) (#16892)
27+
* Ensure wiki repos are all closed (#16886) (#16888)
28+
* List limited and private orgs if authenticated on API (#16866) (#16879)
29+
* Simplify split diff view generation and remove JS dependency (#16775) (#16863)
30+
* Ensure that the default visibility is set on the user create page (#16845) (#16862)
31+
* In Render tolerate not being passed a context (#16842) (#16858)
32+
* Upgrade xorm to v1.2.2 (#16663) & Add test to ensure that dumping of login sources remains correct (#16847) (#16848)
33+
* Report the correct number of pushes on the feeds (#16811) (#16822)
34+
* Add primary_key to issue_index (#16813) (#16820)
35+
* Prevent NPE on empty commit (#16812) (#16819)
36+
* Fix branch pagination error (#16805) (#16816)
37+
* Add missing return to handleSettingRemoteAddrError (#16794) (#16795)
38+
* Remove spurious / from issues.opened_by (#16793)
39+
* Ensure that template compilation panics are sent to the logs (#16788) (#16792)
40+
* Update caddyserver/certmagic (#16789) (#16790)
41+
742
## [1.15.0](https://github.com/go-gitea/gitea/releases/tag/v1.15.0) - 2021-08-21
843

944
* BREAKING
@@ -258,6 +293,15 @@ been added to each release, please refer to the [blog](https://blog.gitea.io).
258293
* Remove utf8 option from installation page (#16126)
259294
* Use Wants= over Requires= in systemd file (#15897)
260295

296+
## [1.14.7](https://github.com/go-gitea/gitea/releases/tag/v1.14.7) - 2021-09-02
297+
298+
* BUGFIXES
299+
* Add missing gitRepo close at GetDiffRangeWithWhitespaceBehavior (Partial #16894) (#16896)
300+
* Fix wiki raw commit diff/patch view (#16891) (#16893)
301+
* Ensure wiki repos are all closed (#16886) (#16889)
302+
* Upgrade xorm to v1.2.2 (#16663) & Add test to ensure that dumping of login sources remains correct (#16847) (#16849)
303+
* Recreate Tables should Recreate indexes on MySQL (#16718) (#16740)
304+
261305
## [1.14.6](https://github.com/go-gitea/gitea/releases/tag/v1.14.6) - 2021-08-04
262306

263307
* SECURITY

build/generate-svg.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ async function processFile(file, {prefix, fullName} = {}) {
3030
{name: 'preset-default'},
3131
{name: 'removeXMLNS'},
3232
{name: 'removeDimensions'},
33+
{name: 'prefixIds', params: {prefix: () => name}},
3334
{name: 'addClassesToSVGElement', params: {classNames: ['svg', name]}},
3435
{name: 'addAttributesToSVGElement', params: {attributes: [{'width': '16'}, {'height': '16'}, {'aria-hidden': 'true'}]}},
3536
],

cmd/admin.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,10 @@ var (
288288
Value: "",
289289
Usage: "Custom icon URL for OAuth2 login source",
290290
},
291+
cli.BoolFlag{
292+
Name: "skip-local-2fa",
293+
Usage: "Set to true to skip local 2fa for users authenticated by this source",
294+
},
291295
}
292296

293297
microcmdAuthUpdateOauth = cli.Command{
@@ -616,6 +620,7 @@ func parseOAuth2Config(c *cli.Context) *oauth2.Source {
616620
OpenIDConnectAutoDiscoveryURL: c.String("auto-discover-url"),
617621
CustomURLMapping: customURLMapping,
618622
IconURL: c.String("icon-url"),
623+
SkipLocalTwoFA: c.Bool("skip-local-2fa"),
619624
}
620625
}
621626

cmd/doctor.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ func runRecreateTable(ctx *cli.Context) error {
124124
}
125125

126126
func runDoctor(ctx *cli.Context) error {
127-
128127
// Silence the default loggers
129128
log.DelNamedLogger("console")
130129
log.DelNamedLogger(log.DEFAULT)

custom/conf/app.example.ini

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -800,9 +800,6 @@ PATH =
800800
;; Prefix archive files by placing them in a directory named after the repository
801801
;PREFIX_ARCHIVE_FILES = true
802802
;;
803-
;; Disable the creation of new mirrors. Pre-existing mirrors remain valid.
804-
;DISABLE_MIRRORS = false
805-
;;
806803
;; Disable migrating feature.
807804
;DISABLE_MIGRATIONS = false
808805
;;
@@ -1945,6 +1942,12 @@ PATH =
19451942
;[mirror]
19461943
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
19471944
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1945+
;; Enables the mirror functionality. Set to **false** to disable all mirrors.
1946+
;ENABLED = true
1947+
;; Disable the creation of **new** pull mirrors. Pre-existing mirrors remain valid. Will be ignored if `mirror.ENABLED` is `false`.
1948+
;DISABLE_NEW_PULL = false
1949+
;; Disable the creation of **new** push mirrors. Pre-existing mirrors remain valid. Will be ignored if `mirror.ENABLED` is `false`.
1950+
;DISABLE_NEW_PUSH = false
19481951
;; Default interval as a duration between each check
19491952
;DEFAULT_INTERVAL = 8h
19501953
;; Min interval as a duration must be > 1m
@@ -1971,8 +1974,8 @@ PATH =
19711974
;[i18n]
19721975
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
19731976
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1974-
;LANGS = en-US,zh-CN,zh-HK,zh-TW,de-DE,fr-FR,nl-NL,lv-LV,ru-RU,uk-UA,ja-JP,es-ES,pt-BR,pt-PT,pl-PL,bg-BG,it-IT,fi-FI,tr-TR,cs-CZ,sr-SP,sv-SE,ko-KR
1975-
;NAMES = English,简体中文,繁體中文(香港),繁體中文(台灣),Deutsch,français,Nederlands,latviešu,русский,Українська,日本語,español,português do Brasil,Português de Portugal,polski,български,italiano,suomi,Türkçe,čeština,српски,svenska,한국어
1977+
;LANGS = en-US,zh-CN,zh-HK,zh-TW,de-DE,fr-FR,nl-NL,lv-LV,ru-RU,uk-UA,ja-JP,es-ES,pt-BR,pt-PT,pl-PL,bg-BG,it-IT,fi-FI,tr-TR,cs-CZ,sr-SP,sv-SE,ko-KR,el-GR,fa-IR,hu-HU,id-ID,ml-IN
1978+
;NAMES = English,简体中文,繁體中文(香港),繁體中文(台灣),Deutsch,français,Nederlands,latviešu,русский,Українська,日本語,español,português do Brasil,Português de Portugal,polski,български,italiano,suomi,Türkçe,čeština,српски,svenska,한국어,ελληνικά,فارسی,magyar nyelv,bahasa Indonesia,മലയാളം
19761979

19771980
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
19781981
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

docs/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ params:
1818
description: Git with a cup of tea
1919
author: The Gitea Authors
2020
website: https://docs.gitea.io
21-
version: 1.15.0
21+
version: 1.15.2
2222
minGoVersion: 1.16
2323
goVersion: 1.17
2424
minNodeVersion: 12.17

docs/content/doc/advanced/config-cheat-sheet.en-us.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
7373
- `DISABLED_REPO_UNITS`: **_empty_**: Comma separated list of globally disabled repo units. Allowed values: \[repo.issues, repo.ext_issues, repo.pulls, repo.wiki, repo.ext_wiki, repo.projects\]
7474
- `DEFAULT_REPO_UNITS`: **repo.code,repo.releases,repo.issues,repo.pulls,repo.wiki,repo.projects**: Comma separated list of default repo units. Allowed values: \[repo.code, repo.releases, repo.issues, repo.pulls, repo.wiki, repo.projects\]. Note: Code and Releases can currently not be deactivated. If you specify default repo units you should still list them for future compatibility. External wiki and issue tracker can't be enabled by default as it requires additional settings. Disabled repo units will not be added to new repositories regardless if it is in the default list.
7575
- `PREFIX_ARCHIVE_FILES`: **true**: Prefix archive files by placing them in a directory named after the repository.
76-
- `DISABLE_MIRRORS`: **false**: Disable the creation of **new** mirrors. Pre-existing mirrors remain valid.
7776
- `DISABLE_MIGRATIONS`: **false**: Disable migrating feature.
7877
- `DISABLE_STARS`: **false**: Disable stars feature.
7978
- `DEFAULT_BRANCH`: **master**: Default branch name of all repositories.
@@ -876,8 +875,8 @@ NB: You must have `DISABLE_ROUTER_LOG` set to `false` for this option to take ef
876875

877876
## i18n (`i18n`)
878877

879-
- `LANGS`: **en-US,zh-CN,zh-HK,zh-TW,de-DE,fr-FR,nl-NL,lv-LV,ru-RU,ja-JP,es-ES,pt-BR,pt-PT,pl-PL,bg-BG,it-IT,fi-FI,tr-TR,cs-CZ,sr-SP,sv-SE,ko-KR**: List of locales shown in language selector
880-
- `NAMES`: **English,简体中文,繁體中文(香港),繁體中文(台灣),Deutsch,français,Nederlands,latviešu,русский,日本語,español,português do Brasil,Português de Portugal,polski,български,italiano,suomi,Türkçe,čeština,српски,svenska,한국어**: Visible names corresponding to the locales
878+
- `LANGS`: **en-US,zh-CN,zh-HK,zh-TW,de-DE,fr-FR,nl-NL,lv-LV,ru-RU,ja-JP,es-ES,pt-BR,pt-PT,pl-PL,bg-BG,it-IT,fi-FI,tr-TR,cs-CZ,sr-SP,sv-SE,ko-KR,el-GR,fa-IR,hu-HU,id-ID,ml-IN**: List of locales shown in language selector
879+
- `NAMES`: **English,简体中文,繁體中文(香港),繁體中文(台灣),Deutsch,français,Nederlands,latviešu,русский,日本語,español,português do Brasil,Português de Portugal,polski,български,italiano,suomi,Türkçe,čeština,српски,svenska,한국어,ελληνικά,فارسی,magyar nyelv,bahasa Indonesia,മലയാളം**: Visible names corresponding to the locales
881880

882881
## U2F (`U2F`)
883882
- `APP_ID`: **`ROOT_URL`**: Declares the facet of the application. Requires HTTPS.
@@ -955,6 +954,9 @@ Task queue configuration has been moved to `queue.task`. However, the below conf
955954

956955
## Mirror (`mirror`)
957956

957+
- `ENABLED`: **true**: Enables the mirror functionality. Set to **false** to disable all mirrors.
958+
- `DISABLE_NEW_PULL`: **false**: Disable the creation of **new** pull mirrors. Pre-existing mirrors remain valid. Will be ignored if `mirror.ENABLED` is `false`.
959+
- `DISABLE_NEW_PUSH`: **false**: Disable the creation of **new** push mirrors. Pre-existing mirrors remain valid. Will be ignored if `mirror.ENABLED` is `false`.
958960
- `DEFAULT_INTERVAL`: **8h**: Default interval between each check
959961
- `MIN_INTERVAL`: **10m**: Minimum interval for checking. (Must be >1m).
960962

docs/content/doc/advanced/mail-templates-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ Please check [Gitea's logs](https://docs.gitea.io/en-us/logging-configuration/)
208208
{{end}}
209209
<p>
210210
<p>
211-
<a href="{{AppURL}}/{{.Doer.LowerName}}">@{{.Doer.Name}}</a>
211+
<a href="{{AppUrl}}/{{.Doer.LowerName}}">@{{.Doer.Name}}</a>
212212
{{if not (eq .Doer.FullName "")}}
213213
({{.Doer.FullName}})
214214
{{end}}
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
date: "2021-09-02T16:00:00+08:00"
3+
title: "Upgrade from an old Gitea"
4+
slug: "upgrade-from-gitea"
5+
weight: 10
6+
toc: false
7+
draft: false
8+
menu:
9+
sidebar:
10+
parent: "upgrade"
11+
name: "From Gitea"
12+
weight: 10
13+
identifier: "upgrade-from-gitea"
14+
---
15+
16+
# Upgrade from an old Gitea
17+
18+
**Table of Contents**
19+
20+
{{< toc >}}
21+
22+
To update Gitea, download a newer version, stop the old one, perform a backup, and run the new one.
23+
Every time a Gitea instance starts up, it checks whether a database migration should be run.
24+
If a database migration is required, Gitea will take some time to complete the upgrade and then serve.
25+
26+
## Backup for downgrade
27+
28+
Gitea keeps compatibility for patch versions whose first two fields are the same (`a.b.x` -> `a.b.y`),
29+
these patch versions can be upgraded and downgraded with the same database structure.
30+
Otherwise (`a.b.?` -> `a.c.?`), a newer Gitea version will upgrade the old database
31+
to a new structure that may differ from the old version.
32+
33+
For example:
34+
35+
| From | To | Result |
36+
| --- | --- | --- |
37+
| 1.4.0 | 1.4.1 ||
38+
| 1.4.1 | 1.4.0 | ⚠️ Not recommended, take your own risk! Although it may work if the database structure doesn't change, it's highly recommended to use a backup to downgrade. |
39+
| 1.4.x | 1.5.y | ✅ Database gets upgraded. You can upgrade from 1.4.x to the latest 1.5.y directly. |
40+
| 1.5.y | 1.4.x | ❌ Database already got upgraded and can not be used for an old Gitea, use a backup to downgrade. |
41+
42+
**Since you can not run an old Gitea with an upgraded database,
43+
a backup should always be made before a database upgrade.**
44+
45+
If you use Gitea in production, it's always highly recommended to make a backup before upgrade,
46+
even if the upgrade is between patch versions.
47+
48+
Backup steps:
49+
50+
* Stop Gitea instance
51+
* Backup database
52+
* Backup Gitea config
53+
* Backup Gitea data files in `APP_DATA_PATH`
54+
* Backup Gitea external storage (eg: S3/MinIO or other storages if used)
55+
56+
If you are using cloud services or filesystems with snapshot feature,
57+
a snapshot for the Gitea data volume and related object storage is more convenient.
58+
59+
60+
## Upgrade with Docker
61+
62+
* `docker pull` the latest Gitea release.
63+
* Stop the running instance, backup data.
64+
* Use `docker` or `docker-compose` to start the newer Gitea Docker container.
65+
66+
## Upgrade from package
67+
68+
* Stop the running instance, backup data.
69+
* Use your package manager to upgrade Gitea to the latest version.
70+
* Start the Gitea instance.
71+
72+
## Upgrade from binary
73+
74+
* Download the latest Gitea binary to a temporary directory.
75+
* Stop the running instance, backup data.
76+
* Replace the installed Gitea binary with the downloaded one.
77+
* Start the Gitea instance.
78+
79+
## Take care about customized templates
80+
81+
Gitea's template structure and variables may change between releases, if you are using customized templates,
82+
do pay attention if your templates are compatible with the Gitea you are using.
83+
84+
If the customized templates don't match Gitea version, you may experience:
85+
`50x` server error, page components missing or malfunctioning, strange page layout, ...
86+
Remove or update the incompatible templates and Gitea web will work again.

docs/content/page/index.de-de.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ Gitea ist ein [Gogs](http://gogs.io)-Fork.
2222

2323
## System Voraussetzungen
2424

25-
- A Raspberry Pi 3 is powerful enough to run Gitea for small workloads.
26-
- 2 CPU cores and 1GB RAM is typically sufficient for small teams/projects.
27-
- Gitea should be run with a dedicated non-root system account on UNIX-type systems.
28-
- Note: Gitea manages the `~/.ssh/authorized_keys` file. Running Gitea as a regular user could break that user's ability to log in.
29-
- [Git](https://git-scm.com/) version 1.7.2 or later is required. Version 1.9.0 or later is recommended. Also please note:
30-
- Git [large file storage](https://git-lfs.github.com/) will be available if enabled when git >= 2.1.2.
31-
- Git commit-graph rendering will be enabled automatically when git >= 2.18.
25+
- Ein Raspberry Pi 3 ist leistungsstark genug, um Gitea für kleine Belastungen laufen zu lassen.
26+
- 2 CPU Kerne und 1GB RAM sind für kleine Teams/Projekte ausreichend.
27+
- Gitea sollte unter einem seperaten nicht-root Account auf UNIX-Systemen ausgeführt werden.
28+
- Achtung: Gitea verwaltet die `~/.ssh/authorized_keys` Datei. Gitea unter einem normalen Benutzer auszuführen könnte dazu führen, dass dieser sich nicht mehr anmelden kann.
29+
- [Git](https://git-scm.com/) Version 1.7.2 oder später wird benötigt. Version 1.9.0 oder später wird empfohlen. Außerdem zu beachten:
30+
- Wenn git >= 2.1.2. und [Git large file storage](https://git-lfs.github.com/) aktiviert ist, dann wird es auch in Gitea verwendbar sein.
31+
- Wenn git >= 2.18, dann wird das Rendern von Commit-Graphen automatisch aktiviert.
3232

3333
## Browser Unterstützung
3434

integrations/api_settings_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func TestAPIExposedSettings(t *testing.T) {
4343

4444
DecodeJSON(t, resp, &repo)
4545
assert.EqualValues(t, &api.GeneralRepoSettings{
46-
MirrorsDisabled: setting.Repository.DisableMirrors,
46+
MirrorsDisabled: !setting.Mirror.Enabled,
4747
HTTPGitDisabled: setting.Repository.DisableHTTPGit,
4848
MigrationsDisabled: setting.Repository.DisableMigrations,
4949
TimeTrackingDisabled: false,

integrations/integration_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ func TestMain(m *testing.M) {
120120
}
121121
exitCode := m.Run()
122122

123-
writerCloser.t = nil
123+
writerCloser.Reset()
124124

125125
if err = util.RemoveAll(setting.Indexer.IssuePath); err != nil {
126126
fmt.Printf("util.RemoveAll: %v\n", err)

integrations/mssql.ini.tmpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ ISSUE_INDEXER_QUEUE_DIR = integrations/gitea-integration-mssql/indexers/issues.q
1515
REPO_INDEXER_ENABLED = true
1616
REPO_INDEXER_PATH = integrations/gitea-integration-mssql/indexers/repos.bleve
1717

18+
[queue]
19+
TYPE = immediate
20+
1821
[queue.code_indexer]
1922
TYPE = immediate
2023

integrations/mysql.ini.tmpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ ISSUE_INDEXER_QUEUE_DIR = integrations/gitea-integration-mysql/indexers/issues.q
1616
REPO_INDEXER_ENABLED = true
1717
REPO_INDEXER_PATH = integrations/gitea-integration-mysql/indexers/repos.bleve
1818

19+
[queue]
20+
TYPE = immediate
21+
1922
[queue.code_indexer]
2023
TYPE = immediate
2124

integrations/mysql8.ini.tmpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ ISSUE_INDEXER_QUEUE_DIR = integrations/gitea-integration-mysql8/indexers/issues.
1515
REPO_INDEXER_ENABLED = true
1616
REPO_INDEXER_PATH = integrations/gitea-integration-mysql8/indexers/repos.bleve
1717

18+
[queue]
19+
TYPE = immediate
20+
1821
[queue.code_indexer]
1922
TYPE = immediate
2023

integrations/pgsql.ini.tmpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ ISSUE_INDEXER_QUEUE_DIR = integrations/gitea-integration-pgsql/indexers/issues.q
1616
REPO_INDEXER_ENABLED = true
1717
REPO_INDEXER_PATH = integrations/gitea-integration-pgsql/indexers/repos.bleve
1818

19+
[queue]
20+
TYPE = immediate
21+
1922
[queue.code_indexer]
2023
TYPE = immediate
2124

integrations/sqlite.ini.tmpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ ISSUE_INDEXER_QUEUE_DIR = integrations/gitea-integration-sqlite/indexers/issues.
1111
REPO_INDEXER_ENABLED = true
1212
REPO_INDEXER_PATH = integrations/gitea-integration-sqlite/indexers/repos.bleve
1313

14+
[queue]
15+
TYPE = immediate
16+
1417
[queue.code_indexer]
1518
TYPE = immediate
1619

integrations/testlogger.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,21 @@ func (w *testLoggerWriterCloser) Close() error {
9090
return nil
9191
}
9292

93+
func (w *testLoggerWriterCloser) Reset() {
94+
w.Lock()
95+
if len(w.t) > 0 {
96+
for _, t := range w.t {
97+
if t == nil {
98+
continue
99+
}
100+
fmt.Fprintf(os.Stdout, "Unclosed logger writer in test: %s", (*t).Name())
101+
(*t).Errorf("Unclosed logger writer in test: %s", (*t).Name())
102+
}
103+
w.t = nil
104+
}
105+
w.Unlock()
106+
}
107+
93108
// PrintCurrentTest prints the current test to os.Stdout
94109
func PrintCurrentTest(t testing.TB, skip ...int) func() {
95110
start := time.Now()

0 commit comments

Comments
 (0)