Skip to content

Commit 1685a35

Browse files
authored
Merge branch 'main' into zzc/dev/agit_2
2 parents 09daf03 + 363c123 commit 1685a35

File tree

202 files changed

+2705
-1087
lines changed

Some content is hidden

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

202 files changed

+2705
-1087
lines changed

.eslintrc.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ rules:
324324
jquery/no-sizzle: [2]
325325
jquery/no-slide: [2]
326326
jquery/no-submit: [2]
327-
jquery/no-text: [0]
327+
jquery/no-text: [2]
328328
jquery/no-toggle: [2]
329329
jquery/no-trigger: [0]
330330
jquery/no-trim: [2]
@@ -477,7 +477,7 @@ rules:
477477
no-jquery/no-slide: [2]
478478
no-jquery/no-sub: [2]
479479
no-jquery/no-support: [2]
480-
no-jquery/no-text: [0]
480+
no-jquery/no-text: [2]
481481
no-jquery/no-trigger: [0]
482482
no-jquery/no-trim: [2]
483483
no-jquery/no-type: [2]
@@ -798,7 +798,7 @@ rules:
798798
unicorn/prefer-object-has-own: [0]
799799
unicorn/prefer-optional-catch-binding: [2]
800800
unicorn/prefer-prototype-methods: [0]
801-
unicorn/prefer-query-selector: [0]
801+
unicorn/prefer-query-selector: [2]
802802
unicorn/prefer-reflect-apply: [0]
803803
unicorn/prefer-regexp-test: [2]
804804
unicorn/prefer-set-has: [0]

.github/pull_request_template.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
<!-- start tips -->
1+
<!-- start tips -->
22
Please check the following:
33
1. Make sure you are targeting the `main` branch, pull requests on release branches are only allowed for backports.
44
2. Make sure you have read contributing guidelines: https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md .
5-
3. Describe what your pull request does and which issue you're targeting (if any).
6-
4. It is recommended to enable "Allow edits by maintainers", so maintainers can help more easily.
7-
5. Your input here will be included in the commit message when this PR has been merged. If you don't want some content to be included, please separate them with a line like `---`.
8-
6. Delete all these tips before posting.
5+
3. For documentations contribution, please go to https://gitea.com/gitea/docs
6+
4. Describe what your pull request does and which issue you're targeting (if any).
7+
5. It is recommended to enable "Allow edits by maintainers", so maintainers can help more easily.
8+
6. Your input here will be included in the commit message when this PR has been merged. If you don't want some content to be included, please separate them with a line like `---`.
9+
7. Delete all these tips before posting.
910
<!-- end tips -->

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ linters:
2222
- typecheck
2323
- unconvert
2424
- unused
25+
- unparam
2526
- wastedassign
2627

2728
run:

CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,8 @@ $REWRITTEN_PR_SUMMARY
358358

359359
## Documentation
360360

361-
If you add a new feature or change an existing aspect of Gitea, the documentation for that feature must be created or updated in the same PR.
361+
If you add a new feature or change an existing aspect of Gitea, the documentation for that feature must be created or updated in another PR at [https://gitea.com/gitea/docs](https://gitea.com/gitea/docs).
362+
**The docs directory on main repository will be removed at some time. We will have a yaml file to store configuration file's meta data. After that completed, configuration documentation should be in the main repository.**
362363

363364
## API v1
364365

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ node_modules: package-lock.json
878878
@touch node_modules
879879

880880
.venv: poetry.lock
881-
poetry install --no-root
881+
poetry install
882882
@touch .venv
883883

884884
.PHONY: update
@@ -895,7 +895,7 @@ update-js: node-check | node_modules
895895
update-py: node-check | node_modules
896896
npx updates -u -f pyproject.toml
897897
rm -rf .venv poetry.lock
898-
poetry install --no-root
898+
poetry install
899899
@touch .venv
900900

901901
.PHONY: fomantic

custom/conf/app.example.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ RUN_USER = ; git
8181
;; Overwrite the automatically generated public URL. Necessary for proxies and docker.
8282
;ROOT_URL = %(PROTOCOL)s://%(DOMAIN)s:%(HTTP_PORT)s/
8383
;;
84+
;; For development purpose only. It makes Gitea handle sub-path ("/sub-path/owner/repo/...") directly when debugging without a reverse proxy.
85+
;; DO NOT USE IT IN PRODUCTION!!!
86+
;USE_SUB_URL_PATH = false
87+
;;
8488
;; when STATIC_URL_PREFIX is empty it will follow ROOT_URL
8589
;STATIC_URL_PREFIX =
8690
;;

flake.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
# backend
3232
go_1_22
33+
gofumpt
3334
];
3435
};
3536
}

models/db/search.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@ const (
1818
SearchOrderByRecentUpdated SearchOrderBy = "updated_unix DESC"
1919
SearchOrderByOldest SearchOrderBy = "created_unix ASC"
2020
SearchOrderByNewest SearchOrderBy = "created_unix DESC"
21-
SearchOrderBySize SearchOrderBy = "size ASC"
22-
SearchOrderBySizeReverse SearchOrderBy = "size DESC"
23-
SearchOrderByGitSize SearchOrderBy = "git_size ASC"
24-
SearchOrderByGitSizeReverse SearchOrderBy = "git_size DESC"
25-
SearchOrderByLFSSize SearchOrderBy = "lfs_size ASC"
26-
SearchOrderByLFSSizeReverse SearchOrderBy = "lfs_size DESC"
2721
SearchOrderByID SearchOrderBy = "id ASC"
2822
SearchOrderByIDReverse SearchOrderBy = "id DESC"
2923
SearchOrderByStars SearchOrderBy = "num_stars ASC"

models/dbfs/dbfile.go

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -215,16 +215,15 @@ func fileTimestampToTime(timestamp int64) time.Time {
215215
return time.UnixMicro(timestamp)
216216
}
217217

218-
func (f *file) loadMetaByPath() (*dbfsMeta, error) {
218+
func (f *file) loadMetaByPath() error {
219219
var fileMeta dbfsMeta
220220
if ok, err := db.GetEngine(f.ctx).Where("full_path = ?", f.fullPath).Get(&fileMeta); err != nil {
221-
return nil, err
221+
return err
222222
} else if ok {
223223
f.metaID = fileMeta.ID
224224
f.blockSize = fileMeta.BlockSize
225-
return &fileMeta, nil
226225
}
227-
return nil, nil
226+
return nil
228227
}
229228

230229
func (f *file) open(flag int) (err error) {
@@ -288,10 +287,7 @@ func (f *file) createEmpty() error {
288287
if err != nil {
289288
return err
290289
}
291-
if _, err = f.loadMetaByPath(); err != nil {
292-
return err
293-
}
294-
return nil
290+
return f.loadMetaByPath()
295291
}
296292

297293
func (f *file) truncate() error {
@@ -368,8 +364,5 @@ func buildPath(path string) string {
368364
func newDbFile(ctx context.Context, path string) (*file, error) {
369365
path = buildPath(path)
370366
f := &file{ctx: ctx, fullPath: path, blockSize: defaultFileBlockSize}
371-
if _, err := f.loadMetaByPath(); err != nil {
372-
return nil, err
373-
}
374-
return f, nil
367+
return f, f.loadMetaByPath()
375368
}

0 commit comments

Comments
 (0)