Files
gitocean/modules/git
oliverpoolandGusted bd0b44d01d chore: use io.ReadFull instead of io.ReadAll for DataAsync (#12795)
Since the final size is already known, no need to `ReadAll` a `LimitedReader`: directly `ReadFull` a properly sized buffer.

Tests are already present in `blob_test.go` (a failure can be triggered by creating a smaller `buf`).

`go test -run=TestBlob_Data -bench=Blob_Data -benchmem` before:
```
Benchmark_Blob_Data-18             43964             28727 ns/op            1373 B/op         11 allocs/op
```
After:
```
Benchmark_Blob_Data-18             41308             27679 ns/op             846 B/op         10 allocs/op
```

🎉 one allocation spared!

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/12795
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
2026-05-28 23:51:15 +02:00
..
2026-04-02 03:29:37 +02:00
2025-11-06 13:23:35 +01:00
2026-04-02 03:29:37 +02:00
2026-04-02 03:29:37 +02:00
2025-01-19 09:42:57 +01:00
2026-04-02 03:29:37 +02:00
2026-04-02 03:29:37 +02:00
2026-04-02 03:29:37 +02:00
2024-08-12 19:11:09 +02:00
2025-01-31 10:43:29 +01:00

Git Module

This module is merged from https://github.com/go-gitea/git which is a Go module to access Git through shell commands. Now it's a part of gitea's main repository for easier pull request.