Skip to content

Commit f47d5dc

Browse files
authored
Merge branch 'main' into refactor_api-repo-unit-update
2 parents 3168285 + 8125633 commit f47d5dc

38 files changed

+1376
-1080
lines changed

.eslintrc.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ module.exports = {
484484
'max-nested-callbacks': [0],
485485
'max-params': [0],
486486
'max-statements': [0],
487-
'multiline-comment-style': [2, 'separate-lines'],
487+
'multiline-comment-style': [0],
488488
'new-cap': [0],
489489
'no-alert': [0],
490490
'no-array-constructor': [0], // handled by @typescript-eslint/no-array-constructor

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest
3636
GO_LICENSES_PACKAGE ?= github.com/google/go-licenses@v1
3737
GOVULNCHECK_PACKAGE ?= golang.org/x/vuln/cmd/govulncheck@v1
3838
ACTIONLINT_PACKAGE ?= github.com/rhysd/actionlint/cmd/actionlint@v1
39-
GOPLS_PACKAGE ?= golang.org/x/tools/gopls@v0.19.1
40-
GOPLS_MODERNIZE_PACKAGE ?= golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@v0.19.1
39+
GOPLS_PACKAGE ?= golang.org/x/tools/gopls@v0.20.0
40+
GOPLS_MODERNIZE_PACKAGE ?= golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@v0.20.0
4141

4242
DOCKER_IMAGE ?= gitea/gitea
4343
DOCKER_TAG ?= latest

modules/git/commit_info.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,21 @@
33

44
package git
55

6-
import "path"
7-
86
// CommitInfo describes the first commit with the provided entry
97
type CommitInfo struct {
108
Entry *TreeEntry
119
Commit *Commit
1210
SubmoduleFile *CommitSubmoduleFile
1311
}
1412

15-
func getCommitInfoSubmoduleFile(repoLink string, entry *TreeEntry, commit *Commit, treePathDir string) (*CommitSubmoduleFile, error) {
16-
fullPath := path.Join(treePathDir, entry.Name())
13+
func GetCommitInfoSubmoduleFile(repoLink, fullPath string, commit *Commit, refCommitID ObjectID) (*CommitSubmoduleFile, error) {
1714
submodule, err := commit.GetSubModule(fullPath)
1815
if err != nil {
1916
return nil, err
2017
}
2118
if submodule == nil {
2219
// unable to find submodule from ".gitmodules" file
23-
return NewCommitSubmoduleFile(repoLink, fullPath, "", entry.ID.String()), nil
20+
return NewCommitSubmoduleFile(repoLink, fullPath, "", refCommitID.String()), nil
2421
}
25-
return NewCommitSubmoduleFile(repoLink, fullPath, submodule.URL, entry.ID.String()), nil
22+
return NewCommitSubmoduleFile(repoLink, fullPath, submodule.URL, refCommitID.String()), nil
2623
}

modules/git/commit_info_gogit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func (tes Entries) GetCommitsInfo(ctx context.Context, repoLink string, commit *
7373

7474
// If the entry is a submodule, add a submodule file for this
7575
if entry.IsSubModule() {
76-
commitsInfo[i].SubmoduleFile, err = getCommitInfoSubmoduleFile(repoLink, entry, commit, treePath)
76+
commitsInfo[i].SubmoduleFile, err = GetCommitInfoSubmoduleFile(repoLink, path.Join(treePath, entry.Name()), commit, entry.ID)
7777
if err != nil {
7878
return nil, nil, err
7979
}

modules/git/commit_info_nogogit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func (tes Entries) GetCommitsInfo(ctx context.Context, repoLink string, commit *
6464

6565
// If the entry is a submodule, add a submodule file for this
6666
if entry.IsSubModule() {
67-
commitsInfo[i].SubmoduleFile, err = getCommitInfoSubmoduleFile(repoLink, entry, commit, treePath)
67+
commitsInfo[i].SubmoduleFile, err = GetCommitInfoSubmoduleFile(repoLink, path.Join(treePath, entry.Name()), commit, entry.ID)
6868
if err != nil {
6969
return nil, nil, err
7070
}

modules/git/commit_info_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ func TestEntries_GetCommitsInfo(t *testing.T) {
125125
t.Run("NonExistingSubmoduleAsNil", func(t *testing.T) {
126126
commit, err := bareRepo1.GetCommit("HEAD")
127127
require.NoError(t, err)
128-
tree, err := commit.GetTreeEntryByPath("file1.txt")
128+
treeEntry, err := commit.GetTreeEntryByPath("file1.txt")
129129
require.NoError(t, err)
130-
cisf, err := getCommitInfoSubmoduleFile("/any/repo-link", tree, commit, "")
130+
cisf, err := GetCommitInfoSubmoduleFile("/any/repo-link", "file1.txt", commit, treeEntry.ID)
131131
require.NoError(t, err)
132132
assert.Equal(t, &CommitSubmoduleFile{
133133
repoLink: "/any/repo-link",

options/locale/locale_en-US.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ path = Path
269269
sqlite_helper = File path for the SQLite3 database.<br>Enter an absolute path if you run Gitea as a service.
270270
reinstall_error = You are trying to install into an existing Gitea database
271271
reinstall_confirm_message = Re-installing with an existing Gitea database can cause multiple problems. In most cases, you should use your existing "app.ini" to run Gitea. If you know what you are doing, confirm the following:
272-
reinstall_confirm_check_1 = The data encrypted by the SECRET_KEY in app.ini may be lost: users may not be able to log in with 2FA/OTP and mirrors may not function correctly. By checking this box, you confirm that the current app.ini file contains the correct the SECRET_KEY.
272+
reinstall_confirm_check_1 = The data encrypted by the SECRET_KEY in app.ini may be lost: users may not be able to log in with 2FA/OTP and mirrors may not function correctly. By checking this box, you confirm that the current app.ini file contains the correct SECRET_KEY.
273273
reinstall_confirm_check_2 = The repositories and settings may need to be resynchronized. By checking this box, you confirm that you will resynchronize the hooks for the repositories and authorized_keys file manually. You confirm that you will ensure that repository and mirror settings are correct.
274274
reinstall_confirm_check_3 = You confirm that you are absolutely sure that this Gitea is running with the correct app.ini location and that you are sure that you have to re-install. You confirm that you acknowledge the above risks.
275275
err_empty_db_path = The SQLite3 database path cannot be empty.
@@ -3253,7 +3253,7 @@ auths.oauth2_required_claim_name_helper = Set this name to restrict login from t
32533253
auths.oauth2_required_claim_value = Required Claim Value
32543254
auths.oauth2_required_claim_value_helper = Set this value to restrict login from this source to users with a claim with this name and value
32553255
auths.oauth2_group_claim_name = Claim name providing group names for this source. (Optional)
3256-
auths.oauth2_full_name_claim_name = Full Name Claim Name. (Optional; if set, the user's full name will always be synchronized with this claim)
3256+
auths.oauth2_full_name_claim_name = Full Name Claim Name. (Optional if set, the user's full name will always be synchronized with this claim)
32573257
auths.oauth2_ssh_public_key_claim_name = SSH Public Key Claim Name
32583258
auths.oauth2_admin_group = Group Claim value for administrator users. (Optional — requires claim name above)
32593259
auths.oauth2_restricted_group = Group Claim value for restricted users. (Optional — requires claim name above)

0 commit comments

Comments
 (0)