Commit graph

1 commit

Author SHA1 Message Date
Gusted
5f514a6e4d chore: refactor LineBlame (#8419)
- Refactor arguments of the function to make more sense.
  - `path` can be inferred from `repo` receiver.
  - `line` can be `uint64`.
- The two calls to this function check for specific errors, do this error checking in the function.
- The ID of a object format is not 40 in the case of SHA256, get the object format and use the correct length.
- Add test coverage for `LineBlame`, notably it checks for the errors that can legitimately happen.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8419
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-07-05 16:31:53 +02:00