feat: update gitea vendor
runner nix smoke / nix label and flake smoke (push) Failing after 1m28s

This commit is contained in:
2026-09-26 21:18:24 +00:00
parent c439c1b948
commit d9b2a4e787
3538 changed files with 116131 additions and 44340 deletions
@@ -4,6 +4,9 @@
package git
import (
"bufio"
"io"
"strings"
"testing"
"github.com/stretchr/testify/assert"
@@ -100,3 +103,31 @@ func TestParseTreeEntriesInvalid(t *testing.T) {
assert.Error(t, err)
assert.Empty(t, entries)
}
func TestParseCatFileTreeLine(t *testing.T) {
input := "100644 looooooooooooooooooooooooong-file-name.txt\x0012345678901234567890"
input += "40755 some-directory\x00abcdefg123abcdefg123"
var readCount int
buf := bufio.NewReaderSize(strings.NewReader(input), 20) // NewReaderSize has a limit: min buffer size = 16
mode, name, objID, n, err := ParseCatFileTreeLine(Sha1ObjectFormat, buf)
readCount += n
assert.NoError(t, err)
assert.Equal(t, EntryModeBlob, mode)
assert.Equal(t, "looooooooooooooooooooooooong-file-name.txt", name)
assert.Equal(t, "12345678901234567890", string(objID.RawValue()))
mode, name, objID, n, err = ParseCatFileTreeLine(Sha1ObjectFormat, buf)
readCount += n
assert.NoError(t, err)
assert.Equal(t, EntryModeTree, mode)
assert.Equal(t, "some-directory", name)
assert.Equal(t, "abcdefg123abcdefg123", string(objID.RawValue()))
assert.Equal(t, len(input), readCount)
_, _, _, n, err = ParseCatFileTreeLine(Sha1ObjectFormat, buf)
assert.ErrorIs(t, err, io.EOF)
assert.Zero(t, n)
}