Skip to content

Commit 95c8978

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: [skip ci] Updated licenses and gitignores Fix bug for generated repository object format (go-gitea#28969) Fixing small space missing in sample config file (go-gitea#28967) Fix inconsistent naming of OAuth 2.0 `ENABLE` setting (go-gitea#28951) Add screenshot for "Profile Readmes" to docs (go-gitea#28964) Simplify how git repositories are opened (go-gitea#28937) Preserve BOM in web editor (go-gitea#28935) Make loading animation less aggressive (go-gitea#28955) Fix SSPI user creation (go-gitea#28948) Strip `/` from relative links (go-gitea#28932) Fix non-alphabetic sorting of repo topics (go-gitea#28938) Don't remove all mirror repository's releases when mirroring (go-gitea#28817) Use new RPM constants (go-gitea#28931) Check for sha256 support to use --object-format flag (go-gitea#28928) fix: update enable_prune even if mirror_interval is not provided (go-gitea#28905) Implement `MigrateRepository` for the actions notifier (go-gitea#28920) Respect branch info for relative links (go-gitea#28909)
2 parents 40a7eb6 + 2a50d78 commit 95c8978

File tree

115 files changed

+751
-467
lines changed

Some content is hidden

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

115 files changed

+751
-467
lines changed

cmd/admin.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"code.gitea.io/gitea/models/db"
1212
repo_model "code.gitea.io/gitea/models/repo"
1313
"code.gitea.io/gitea/modules/git"
14+
"code.gitea.io/gitea/modules/gitrepo"
1415
"code.gitea.io/gitea/modules/log"
1516
repo_module "code.gitea.io/gitea/modules/repository"
1617

@@ -122,7 +123,7 @@ func runRepoSyncReleases(_ *cli.Context) error {
122123
log.Trace("Processing next %d repos of %d", len(repos), count)
123124
for _, repo := range repos {
124125
log.Trace("Synchronizing repo %s with path %s", repo.FullName(), repo.RepoPath())
125-
gitRepo, err := git.OpenRepository(ctx, repo.RepoPath())
126+
gitRepo, err := gitrepo.OpenRepository(ctx, repo)
126127
if err != nil {
127128
log.Warn("OpenRepository: %v", err)
128129
continue

custom/conf/app.example.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ SECRET_KEY =
431431
;SECRET_KEY_URI = file:/etc/gitea/secret_key
432432
;;
433433
;; Secret used to validate communication within Gitea binary.
434-
INTERNAL_TOKEN=
434+
INTERNAL_TOKEN =
435435
;;
436436
;; Alternative location to specify internal token, instead of this file; you cannot specify both this and INTERNAL_TOKEN, and must pick one
437437
;INTERNAL_TOKEN_URI = file:/etc/gitea/internal_token
@@ -524,7 +524,7 @@ INTERNAL_TOKEN=
524524
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
525525
;;
526526
;; Enables OAuth2 provider
527-
ENABLE = true
527+
ENABLED = true
528528
;;
529529
;; Algorithm used to sign OAuth2 tokens. Valid values: HS256, HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512, EdDSA
530530
;JWT_SIGNING_ALGORITHM = RS256

docs/content/administration/config-cheat-sheet.en-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,7 @@ This section only does "set" config, a removed config key from this section won'
11071107

11081108
## OAuth2 (`oauth2`)
11091109

1110-
- `ENABLE`: **true**: Enables OAuth2 provider.
1110+
- `ENABLED`: **true**: Enables OAuth2 provider.
11111111
- `ACCESS_TOKEN_EXPIRATION_TIME`: **3600**: Lifetime of an OAuth2 access token in seconds
11121112
- `REFRESH_TOKEN_EXPIRATION_TIME`: **730**: Lifetime of an OAuth2 refresh token in hours
11131113
- `INVALIDATE_REFRESH_TOKENS`: **false**: Check if refresh token has already been used

docs/content/administration/config-cheat-sheet.zh-cn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1043,7 +1043,7 @@ Gitea 创建以下非唯一队列:
10431043

10441044
## OAuth2 (`oauth2`)
10451045

1046-
- `ENABLE`: **true**:启用OAuth2提供者。
1046+
- `ENABLED`: **true**:启用OAuth2提供者。
10471047
- `ACCESS_TOKEN_EXPIRATION_TIME`**3600**:OAuth2访问令牌的生命周期,以秒为单位。
10481048
- `REFRESH_TOKEN_EXPIRATION_TIME`**730**:OAuth2刷新令牌的生命周期,以小时为单位。
10491049
- `INVALIDATE_REFRESH_TOKENS`**false**:检查刷新令牌是否已被使用。

docs/content/usage/profile-readme.en-us.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,7 @@ To display a Markdown file in your Gitea user or organization profile page, crea
1919
Gitea will automatically display the contents of the file on your profile, in a new "Overview" above your repositories.
2020

2121
Making the `.profile` repository private will hide the Profile README.
22+
23+
Example of user with `.profile/README.md`:
24+
25+
![profile readme screenshot](./profile-readme.png)

docs/content/usage/profile-readme.png

32.9 KB
Loading

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ require (
9292
github.com/redis/go-redis/v9 v9.4.0
9393
github.com/robfig/cron/v3 v3.0.1
9494
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1
95-
github.com/sassoftware/go-rpmutils v0.2.0
95+
github.com/sassoftware/go-rpmutils v0.2.1-0.20240124161140-277b154961dd
9696
github.com/sergi/go-diff v1.3.1
9797
github.com/shurcooL/vfsgen v0.0.0-20230704071429-0000e147ea92
9898
github.com/stretchr/testify v1.8.4

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -781,8 +781,8 @@ github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6g
781781
github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ=
782782
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6NgVqpn3+iol9aGu4=
783783
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY=
784-
github.com/sassoftware/go-rpmutils v0.2.0 h1:pKW0HDYMFWQ5b4JQPiI3WI12hGsVoW0V8+GMoZiI/JE=
785-
github.com/sassoftware/go-rpmutils v0.2.0/go.mod h1:TJJQYtLe/BeEmEjelI3b7xNZjzAukEkeWKmoakvaOoI=
784+
github.com/sassoftware/go-rpmutils v0.2.1-0.20240124161140-277b154961dd h1:KpbqRPDwcAQTyaP+L+YudTRb3CnJlQ64Hfn1SF/zHBA=
785+
github.com/sassoftware/go-rpmutils v0.2.1-0.20240124161140-277b154961dd/go.mod h1:TJJQYtLe/BeEmEjelI3b7xNZjzAukEkeWKmoakvaOoI=
786786
github.com/segmentio/asm v1.2.0 h1:9BQrFxC+YOHJlTlHGkTrFWf59nbL3XnCoFLTwDCI7ys=
787787
github.com/segmentio/asm v1.2.0/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs=
788788
github.com/serenize/snaker v0.0.0-20171204205717-a683aaf2d516/go.mod h1:Yow6lPLSAXx2ifx470yD/nUe22Dv5vBvxK/UK9UUTVs=

models/activities/repo_activity.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
repo_model "code.gitea.io/gitea/models/repo"
1515
user_model "code.gitea.io/gitea/models/user"
1616
"code.gitea.io/gitea/modules/git"
17+
"code.gitea.io/gitea/modules/gitrepo"
1718

1819
"xorm.io/xorm"
1920
)
@@ -65,7 +66,7 @@ func GetActivityStats(ctx context.Context, repo *repo_model.Repository, timeFrom
6566
return nil, fmt.Errorf("FillUnresolvedIssues: %w", err)
6667
}
6768
if code {
68-
gitRepo, closer, err := git.RepositoryFromContextOrOpen(ctx, repo.RepoPath())
69+
gitRepo, closer, err := gitrepo.RepositoryFromContextOrOpen(ctx, repo)
6970
if err != nil {
7071
return nil, fmt.Errorf("OpenRepository: %w", err)
7172
}
@@ -82,7 +83,7 @@ func GetActivityStats(ctx context.Context, repo *repo_model.Repository, timeFrom
8283

8384
// GetActivityStatsTopAuthors returns top author stats for git commits for all branches
8485
func GetActivityStatsTopAuthors(ctx context.Context, repo *repo_model.Repository, timeFrom time.Time, count int) ([]*ActivityAuthorData, error) {
85-
gitRepo, closer, err := git.RepositoryFromContextOrOpen(ctx, repo.RepoPath())
86+
gitRepo, closer, err := gitrepo.RepositoryFromContextOrOpen(ctx, repo)
8687
if err != nil {
8788
return nil, fmt.Errorf("OpenRepository: %w", err)
8889
}

models/issues/comment.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
repo_model "code.gitea.io/gitea/models/repo"
1919
user_model "code.gitea.io/gitea/models/user"
2020
"code.gitea.io/gitea/modules/container"
21-
"code.gitea.io/gitea/modules/git"
21+
"code.gitea.io/gitea/modules/gitrepo"
2222
"code.gitea.io/gitea/modules/json"
2323
"code.gitea.io/gitea/modules/log"
2424
"code.gitea.io/gitea/modules/references"
@@ -762,8 +762,7 @@ func (c *Comment) LoadPushCommits(ctx context.Context) (err error) {
762762
c.OldCommit = data.CommitIDs[0]
763763
c.NewCommit = data.CommitIDs[1]
764764
} else {
765-
repoPath := c.Issue.Repo.RepoPath()
766-
gitRepo, closer, err := git.RepositoryFromContextOrOpen(ctx, repoPath)
765+
gitRepo, closer, err := gitrepo.RepositoryFromContextOrOpen(ctx, c.Issue.Repo)
767766
if err != nil {
768767
return err
769768
}

0 commit comments

Comments
 (0)