Skip to content

Commit 2a235dc

Browse files
committed
fix comment, ignore SetEditorconfigIfExists error
1 parent bc61be3 commit 2a235dc

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

routers/web/repo/middlewares.go

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,9 @@
44
package repo
55

66
import (
7-
"fmt"
87
"strconv"
98

10-
system_model "code.gitea.io/gitea/models/system"
119
user_model "code.gitea.io/gitea/models/user"
12-
"code.gitea.io/gitea/modules/git"
1310
"code.gitea.io/gitea/modules/optional"
1411
"code.gitea.io/gitea/services/context"
1512
user_service "code.gitea.io/gitea/services/user"
@@ -22,12 +19,9 @@ func SetEditorconfigIfExists(ctx *context.Context) {
2219
}
2320

2421
ec, _, err := ctx.Repo.GetEditorconfig()
25-
26-
if err != nil && !git.IsErrNotExist(err) {
27-
description := fmt.Sprintf("Error while getting .editorconfig file: %v", err)
28-
if err := system_model.CreateRepositoryNotice(description); err != nil {
29-
ctx.ServerError("ErrCreatingReporitoryNotice", err)
30-
}
22+
if err != nil {
23+
// it used to check `!git.IsErrNotExist(err)` and create a system notice, but it is quite annoying and useless
24+
// because network errors also happen frequently, so we just ignore it
3125
return
3226
}
3327

services/context/repo.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,11 @@ func (r *Repository) GetCommitGraphsCount(ctx context.Context, hidePRRefs bool,
204204
})
205205
}
206206

207-
// RefTypeNameSubURL sub-url for the BranchName field, for example:
207+
// RefTypeNameSubURL makes a sub-url for the current ref (branch/tag/commit) field, for example:
208208
// * "branch/master"
209209
// * "tag/v1.0.0"
210210
// * "commit/123456"
211-
// It is usually used to construct a link for lie ".../src/{RefTypeNameSubURL}/{TreePath}"
211+
// It is usually used to construct a link like ".../src/{{RefTypeNameSubURL}}/{{PathEscapeSegments TreePath}}"
212212
func (r *Repository) RefTypeNameSubURL() string {
213213
switch {
214214
case r.IsViewBranch:

templates/repo/settings/collaboration.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
</form>
4949
</div>
5050

51-
{{if and $.Repository.Owner $.Repository.Owner.IsOrganization}}
51+
{{if $.Repository.Owner.IsOrganization}}
5252
<h4 class="ui top attached header">
5353
{{ctx.Locale.Tr "repo.settings.teams"}}
5454
</h4>

0 commit comments

Comments
 (0)