types: fix redact Gitolite and Other that have no secret fields (#19976)

* types: fix redact Gitolite and Other that have no secret fields

* Update CHANGELOG
This commit is contained in:
ᴜɴᴋɴᴡᴏɴ 2021-04-13 23:46:34 +08:00 committed by GitHub
parent 9f36a44b3e
commit bfcb232600
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -33,6 +33,7 @@ All notable changes to Sourcegraph are documented in this file.
- A regression caused by search onboarding tour logic to never focus input in the search bar on the homepage. Input now focuses on the homepage if the search tour isn't in effect. [#19678](https://github.com/sourcegraph/sourcegraph/pull/19678)
- New changes of a Perforce depot will now be reflected in `master` branch after the initial clone. [#19718](https://github.com/sourcegraph/sourcegraph/pull/19718)
- Gitolite and Other type code host connection configuration can be correctly displayed. [#19976](https://github.com/sourcegraph/sourcegraph/pull/19976)
## 3.26.3

View File

@ -65,10 +65,9 @@ func (e *ExternalService) RedactConfigSecrets() error {
case *schema.PerforceConnection:
newCfg, err = redactField(e.Config, "p4.passwd")
case *schema.GitoliteConnection:
// no secret fields?
newCfg, err = redactField(e.Config, "url")
// Gitolite has no secret fields
newCfg, err = redactField(e.Config)
case *schema.OtherExternalServiceConnection:
// no secret fields?
newCfg, err = redactField(e.Config, "url")
default:
// return an error here, it's safer to fail than to incorrectly return unsafe data.