forgejo/services/convert
Gusted 00761a15d1 chore: simplify GetDiff (#7682)
- Split `GetDiff` into two functions, `GetDiffSimple` and `GetDiffFull`. The former will do the bare minimum and really only get a Git diff while the latter does some extra stuff that's relevant for the frontend to show extra relevant.
- Use `GetDiffSimple` for API related calls, as they do not benefit nor are returning the extra information that `GetDiffFull` provides, this should show a measurable performance increase for API calls that returns commits and `/repos/{owner}/{repo}/pulls/{index}/files`.
- `GetDiffSimple` contains extra code comments about its interesting way to determine the before commit.
- Add unit tests to demonstrates that the logic for determining the before commit didn't change and the function still yields correct information.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7682
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-04-27 19:49:59 +00:00
..
activity.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
attachment.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
convert.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
git_commit.go chore: simplify GetDiff (#7682) 2025-04-27 19:49:59 +00:00
git_commit_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
issue.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
issue_comment.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
issue_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
main_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
mirror.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
notification.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
package.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
pull.go fix(migrations): transfer PR flow information (#7421) 2025-04-03 06:47:37 +00:00
pull_review.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
pull_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
quota.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
release.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
release_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
repository.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
status.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
user.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
user_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
utils.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
utils_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
wiki.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00