1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-07-25 12:39:40 +02:00
forgejo/services/repository/files
oliverpool 225a0f7026 git/TreeEntry: LinkTarget simplification (#8323)
See #8222 for context.

This PR removes a call to `Blob.GetBlobContent` and `Blob.DataAsync` and unifies symlink resolution:
- length was unlimited in one case
- length was truncated to 1024 chars in the other case

Now it is hard-limited to 4096 chars (ie error if larger), which is a length which seems appropriate according to https://stackoverflow.com/a/22575737.

### Tests

- Tests are already present in `tests/integration/repo_test.go:972`: `TestRepoFollowSymlink` (it caught a cap/len stupid mistake).
- [x] I did not document these changes and I do not expect someone else to do it.
- [x] I do not want this change to show in the release notes.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8323
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: oliverpool <git@olivier.pfad.fr>
Co-committed-by: oliverpool <git@olivier.pfad.fr>
2025-06-27 23:10:09 +02:00
..
cherry_pick.go chore(cleanup): replaces unnecessary calls to formatting functions by non-formatting equivalents (#7994) 2025-05-29 17:34:29 +02:00
commit.go feat: improved performances when checking for conflicts on pull requests (#7727) 2025-05-16 12:40:38 +00:00
content.go git/TreeEntry: LinkTarget simplification (#8323) 2025-06-27 23:10:09 +02:00
content_test.go feat: API GET /repos/{owner}/{repo}/git/blobs 2025-06-13 13:52:56 +02:00
diff.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
diff_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
file.go fix: pass doer's ID for CRUD instance signing (#8304) 2025-06-27 15:43:31 +02:00
file_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
patch.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
temp_repo.go chore(cleanup): replaces unnecessary calls to formatting functions by non-formatting equivalents (#7994) 2025-05-29 17:34:29 +02:00
temp_repo_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
tree.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
tree_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
update.go API: enforce sha requirement on POST /repos/{owner}/{repo}/contents (#8139) 2025-06-12 00:13:39 +02:00
upload.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00