diff options
| author | 2026-03-10 14:07:54 +0800 | |
|---|---|---|
| committer | 2026-03-10 14:07:54 +0800 | |
| commit | c2cb06aa23a1769a0d84756acccf1ac1358f61ef (patch) | |
| tree | 86d991b67542dd8e8509a74c832b749ccf948342 | |
| parent | commitgraph: Move out of format/ (diff) | |
| signature | No signature | |
*: format/pack -> packfile; format/delta -> delta; delete format
| -rw-r--r-- | cmd/index-pack/main.go | 2 | ||||
| -rw-r--r-- | delta/apply/apply.go (renamed from format/delta/apply/apply.go) | 28 | ||||
| -rw-r--r-- | delta/apply/header.go (renamed from format/delta/apply/header.go) | 4 | ||||
| -rw-r--r-- | delta/doc.go (renamed from format/delta/doc.go) | 0 | ||||
| -rw-r--r-- | format/doc.go | 2 | ||||
| -rw-r--r-- | internal/commitquery/oid.go | 2 | ||||
| -rw-r--r-- | objectstore/packed/delta_build_chain.go | 2 | ||||
| -rw-r--r-- | objectstore/packed/delta_resolve_chain.go | 2 | ||||
| -rw-r--r-- | objectstore/packed/delta_resolve_chain_start.go | 2 | ||||
| -rw-r--r-- | objectstore/packed/delta_resolve_content.go | 2 | ||||
| -rw-r--r-- | objectstore/packed/delta_size.go | 2 | ||||
| -rw-r--r-- | objectstore/packed/entry_parse.go | 2 | ||||
| -rw-r--r-- | objectstore/packed/pack.go | 2 | ||||
| -rw-r--r-- | objectstore/packed/read_header_resolve.go | 2 | ||||
| -rw-r--r-- | objectstore/packed/read_reader.go | 2 | ||||
| -rw-r--r-- | objectstore/packed/read_size.go | 2 | ||||
| -rw-r--r-- | packfile/entry.go (renamed from format/pack/entry.go) | 16 | ||||
| -rw-r--r-- | packfile/ingest/api.go (renamed from format/pack/ingest/api.go) | 2 | ||||
| -rw-r--r-- | packfile/ingest/byteslice_reader.go (renamed from format/pack/ingest/byteslice_reader.go) | 0 | ||||
| -rw-r--r-- | packfile/ingest/cache.go (renamed from format/pack/ingest/cache.go) | 0 | ||||
| -rw-r--r-- | packfile/ingest/counting_writer.go (renamed from format/pack/ingest/counting_writer.go) | 0 | ||||
| -rw-r--r-- | packfile/ingest/crc.go (renamed from format/pack/ingest/crc.go) | 2 | ||||
| -rw-r--r-- | packfile/ingest/delta_header.go (renamed from format/pack/ingest/delta_header.go) | 2 | ||||
| -rw-r--r-- | packfile/ingest/distance.go (renamed from format/pack/ingest/distance.go) | 0 | ||||
| -rw-r--r-- | packfile/ingest/doc.go (renamed from format/pack/ingest/doc.go) | 0 | ||||
| -rw-r--r-- | packfile/ingest/drain.go (renamed from format/pack/ingest/drain.go) | 2 | ||||
| -rw-r--r-- | packfile/ingest/entry.go (renamed from format/pack/ingest/entry.go) | 2 | ||||
| -rw-r--r-- | packfile/ingest/entry_header.go (renamed from format/pack/ingest/entry_header.go) | 0 | ||||
| -rw-r--r-- | packfile/ingest/entry_prefix.go (renamed from format/pack/ingest/entry_prefix.go) | 0 | ||||
| -rw-r--r-- | packfile/ingest/errors.go (renamed from format/pack/ingest/errors.go) | 20 | ||||
| -rw-r--r-- | packfile/ingest/file_section_writer.go (renamed from format/pack/ingest/file_section_writer.go) | 0 | ||||
| -rw-r--r-- | packfile/ingest/fill.go (renamed from format/pack/ingest/fill.go) | 2 | ||||
| -rw-r--r-- | packfile/ingest/finalize.go (renamed from format/pack/ingest/finalize.go) | 4 | ||||
| -rw-r--r-- | packfile/ingest/flush.go (renamed from format/pack/ingest/flush.go) | 0 | ||||
| -rw-r--r-- | packfile/ingest/hash.go (renamed from format/pack/ingest/hash.go) | 2 | ||||
| -rw-r--r-- | packfile/ingest/header.go (renamed from format/pack/ingest/header.go) | 2 | ||||
| -rw-r--r-- | packfile/ingest/idx_write.go (renamed from format/pack/ingest/idx_write.go) | 2 | ||||
| -rw-r--r-- | packfile/ingest/ingest.go (renamed from format/pack/ingest/ingest.go) | 0 | ||||
| -rw-r--r-- | packfile/ingest/ingest_test.go (renamed from format/pack/ingest/ingest_test.go) | 2 | ||||
| -rw-r--r-- | packfile/ingest/progress_write.go (renamed from format/pack/ingest/progress_write.go) | 0 | ||||
| -rw-r--r-- | packfile/ingest/record_content.go (renamed from format/pack/ingest/record_content.go) | 4 | ||||
| -rw-r--r-- | packfile/ingest/record_delta.go (renamed from format/pack/ingest/record_delta.go) | 4 | ||||
| -rw-r--r-- | packfile/ingest/record_inflate.go (renamed from format/pack/ingest/record_inflate.go) | 0 | ||||
| -rw-r--r-- | packfile/ingest/record_resolve.go (renamed from format/pack/ingest/record_resolve.go) | 4 | ||||
| -rw-r--r-- | packfile/ingest/records.go (renamed from format/pack/ingest/records.go) | 0 | ||||
| -rw-r--r-- | packfile/ingest/resolve_all.go (renamed from format/pack/ingest/resolve_all.go) | 0 | ||||
| -rw-r--r-- | packfile/ingest/rev_write.go (renamed from format/pack/ingest/rev_write.go) | 0 | ||||
| -rw-r--r-- | packfile/ingest/rewrite_header_trailer.go (renamed from format/pack/ingest/rewrite_header_trailer.go) | 0 | ||||
| -rw-r--r-- | packfile/ingest/scan.go (renamed from format/pack/ingest/scan.go) | 4 | ||||
| -rw-r--r-- | packfile/ingest/state.go (renamed from format/pack/ingest/state.go) | 0 | ||||
| -rw-r--r-- | packfile/ingest/stream.go (renamed from format/pack/ingest/stream.go) | 0 | ||||
| -rw-r--r-- | packfile/ingest/temp.go (renamed from format/pack/ingest/temp.go) | 4 | ||||
| -rw-r--r-- | packfile/ingest/testdata/fixtures/sha1/METADATA.txt (renamed from format/pack/ingest/testdata/fixtures/sha1/METADATA.txt) | 0 | ||||
| -rw-r--r-- | packfile/ingest/testdata/fixtures/sha1/base.pack (renamed from format/pack/ingest/testdata/fixtures/sha1/base.pack) | bin | 81007 -> 81007 bytes | |||
| -rw-r--r-- | packfile/ingest/testdata/fixtures/sha1/nonthin.pack (renamed from format/pack/ingest/testdata/fixtures/sha1/nonthin.pack) | bin | 117458 -> 117458 bytes | |||
| -rw-r--r-- | packfile/ingest/testdata/fixtures/sha1/thin.pack (renamed from format/pack/ingest/testdata/fixtures/sha1/thin.pack) | bin | 38581 -> 38581 bytes | |||
| -rw-r--r-- | packfile/ingest/testdata/fixtures/sha256/METADATA.txt (renamed from format/pack/ingest/testdata/fixtures/sha256/METADATA.txt) | 0 | ||||
| -rw-r--r-- | packfile/ingest/testdata/fixtures/sha256/base.pack (renamed from format/pack/ingest/testdata/fixtures/sha256/base.pack) | bin | 105138 -> 105138 bytes | |||
| -rw-r--r-- | packfile/ingest/testdata/fixtures/sha256/nonthin.pack (renamed from format/pack/ingest/testdata/fixtures/sha256/nonthin.pack) | bin | 152284 -> 152284 bytes | |||
| -rw-r--r-- | packfile/ingest/testdata/fixtures/sha256/thin.pack (renamed from format/pack/ingest/testdata/fixtures/sha256/thin.pack) | bin | 49412 -> 49412 bytes | |||
| -rw-r--r-- | packfile/ingest/thin_append.go (renamed from format/pack/ingest/thin_append.go) | 0 | ||||
| -rw-r--r-- | packfile/ingest/thin_fix.go (renamed from format/pack/ingest/thin_fix.go) | 4 | ||||
| -rw-r--r-- | packfile/ingest/thin_unresolved.go (renamed from format/pack/ingest/thin_unresolved.go) | 0 | ||||
| -rw-r--r-- | packfile/ingest/trailer.go (renamed from format/pack/ingest/trailer.go) | 6 | ||||
| -rw-r--r-- | packfile/ingest/use.go (renamed from format/pack/ingest/use.go) | 2 | ||||
| -rw-r--r-- | packfile/pack.go (renamed from format/pack/pack.go) | 4 | ||||
| -rw-r--r-- | protocol/v0v1/server/receivepack/parse_test.go | 2 | ||||
| -rw-r--r-- | protocol/v0v1/server/receivepack/report_status_test.go | 4 | ||||
| -rw-r--r-- | protocol/v0v1/server/session.go | 2 | ||||
| -rw-r--r-- | receivepack/int_test.go | 4 | ||||
| -rw-r--r-- | receivepack/service/ingest_quarantine.go | 2 | ||||
| -rw-r--r-- | receivepack/service/result.go | 2 |
72 files changed, 84 insertions, 86 deletions
diff --git a/cmd/index-pack/main.go b/cmd/index-pack/main.go index cfd80f6a..37458744 100644 --- a/cmd/index-pack/main.go +++ b/cmd/index-pack/main.go @@ -8,9 +8,9 @@ import ( "os" "path/filepath" - "codeberg.org/lindenii/furgit/format/pack/ingest" "codeberg.org/lindenii/furgit/objectid" "codeberg.org/lindenii/furgit/objectstore" + "codeberg.org/lindenii/furgit/packfile/ingest" "codeberg.org/lindenii/furgit/repository" ) diff --git a/format/delta/apply/apply.go b/delta/apply/apply.go index cd53f837..f5006e3c 100644 --- a/format/delta/apply/apply.go +++ b/delta/apply/apply.go @@ -18,7 +18,7 @@ func Apply(base, delta []byte) ([]byte, error) { } if srcSize != len(base) { - return nil, fmt.Errorf("format/delta/apply: delta source size mismatch: got %d want %d", srcSize, len(base)) + return nil, fmt.Errorf("delta/apply: delta source size mismatch: got %d want %d", srcSize, len(base)) } out := make([]byte, dstSize) @@ -34,7 +34,7 @@ func Apply(base, delta []byte) ([]byte, error) { if op&0x01 != 0 { if pos >= len(delta) { - return nil, fmt.Errorf("format/delta/apply: malformed delta copy offset") + return nil, fmt.Errorf("delta/apply: malformed delta copy offset") } off |= int(delta[pos]) @@ -43,7 +43,7 @@ func Apply(base, delta []byte) ([]byte, error) { if op&0x02 != 0 { if pos >= len(delta) { - return nil, fmt.Errorf("format/delta/apply: malformed delta copy offset") + return nil, fmt.Errorf("delta/apply: malformed delta copy offset") } off |= int(delta[pos]) << 8 @@ -52,7 +52,7 @@ func Apply(base, delta []byte) ([]byte, error) { if op&0x04 != 0 { if pos >= len(delta) { - return nil, fmt.Errorf("format/delta/apply: malformed delta copy offset") + return nil, fmt.Errorf("delta/apply: malformed delta copy offset") } off |= int(delta[pos]) << 16 @@ -61,7 +61,7 @@ func Apply(base, delta []byte) ([]byte, error) { if op&0x08 != 0 { if pos >= len(delta) { - return nil, fmt.Errorf("format/delta/apply: malformed delta copy offset") + return nil, fmt.Errorf("delta/apply: malformed delta copy offset") } off |= int(delta[pos]) << 24 @@ -72,7 +72,7 @@ func Apply(base, delta []byte) ([]byte, error) { if op&0x10 != 0 { if pos >= len(delta) { - return nil, fmt.Errorf("format/delta/apply: malformed delta copy size") + return nil, fmt.Errorf("delta/apply: malformed delta copy size") } n |= int(delta[pos]) @@ -81,7 +81,7 @@ func Apply(base, delta []byte) ([]byte, error) { if op&0x20 != 0 { if pos >= len(delta) { - return nil, fmt.Errorf("format/delta/apply: malformed delta copy size") + return nil, fmt.Errorf("delta/apply: malformed delta copy size") } n |= int(delta[pos]) << 8 @@ -90,7 +90,7 @@ func Apply(base, delta []byte) ([]byte, error) { if op&0x40 != 0 { if pos >= len(delta) { - return nil, fmt.Errorf("format/delta/apply: malformed delta copy size") + return nil, fmt.Errorf("delta/apply: malformed delta copy size") } n |= int(delta[pos]) << 16 @@ -102,7 +102,7 @@ func Apply(base, delta []byte) ([]byte, error) { } if off < 0 || n < 0 || off+n > len(base) || outPos+n > len(out) { - return nil, fmt.Errorf("format/delta/apply: delta copy out of bounds") + return nil, fmt.Errorf("delta/apply: delta copy out of bounds") } copy(out[outPos:outPos+n], base[off:off+n]) @@ -112,12 +112,12 @@ func Apply(base, delta []byte) ([]byte, error) { } if op == 0 { - return nil, fmt.Errorf("format/delta/apply: invalid delta opcode 0") + return nil, fmt.Errorf("delta/apply: invalid delta opcode 0") } n := int(op) if pos+n > len(delta) || outPos+n > len(out) { - return nil, fmt.Errorf("format/delta/apply: delta insert out of bounds") + return nil, fmt.Errorf("delta/apply: delta insert out of bounds") } copy(out[outPos:outPos+n], delta[pos:pos+n]) @@ -126,7 +126,7 @@ func Apply(base, delta []byte) ([]byte, error) { } if outPos != len(out) { - return nil, fmt.Errorf("format/delta/apply: delta output size mismatch: got %d want %d", outPos, len(out)) + return nil, fmt.Errorf("delta/apply: delta output size mismatch: got %d want %d", outPos, len(out)) } return out, nil @@ -139,7 +139,7 @@ func readVarint(buf []byte, pos *int) (int, error) { for { if *pos >= len(buf) { - return 0, fmt.Errorf("format/delta/apply: malformed delta varint") + return 0, fmt.Errorf("delta/apply: malformed delta varint") } b := buf[*pos] @@ -152,7 +152,7 @@ func readVarint(buf []byte, pos *int) (int, error) { shift += 7 if shift > 63 { - return 0, fmt.Errorf("format/delta/apply: delta varint overflow") + return 0, fmt.Errorf("delta/apply: delta varint overflow") } } diff --git a/format/delta/apply/header.go b/delta/apply/header.go index dbd29550..69c9659a 100644 --- a/format/delta/apply/header.go +++ b/delta/apply/header.go @@ -31,7 +31,7 @@ func readVarintFromByteReader(reader io.ByteReader) (int, error) { for { b, err := reader.ReadByte() if err != nil { - return 0, fmt.Errorf("format/delta/apply: malformed delta varint: %w", err) + return 0, fmt.Errorf("delta/apply: malformed delta varint: %w", err) } value |= int(b&0x7f) << shift @@ -41,7 +41,7 @@ func readVarintFromByteReader(reader io.ByteReader) (int, error) { shift += 7 if shift > 63 { - return 0, fmt.Errorf("format/delta/apply: delta varint overflow") + return 0, fmt.Errorf("delta/apply: delta varint overflow") } } } diff --git a/format/delta/doc.go b/delta/doc.go index f63c96a8..f63c96a8 100644 --- a/format/delta/doc.go +++ b/delta/doc.go diff --git a/format/doc.go b/format/doc.go deleted file mode 100644 index d84b09e5..00000000 --- a/format/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Package format encapsulates constants and general-purpose routines for Git-related formats. -package format diff --git a/internal/commitquery/oid.go b/internal/commitquery/oid.go index a1e7baa0..927c0220 100644 --- a/internal/commitquery/oid.go +++ b/internal/commitquery/oid.go @@ -3,8 +3,8 @@ package commitquery import ( stderrors "errors" - giterrors "codeberg.org/lindenii/furgit/errors" commitgraphread "codeberg.org/lindenii/furgit/commitgraph/read" + giterrors "codeberg.org/lindenii/furgit/errors" "codeberg.org/lindenii/furgit/object" "codeberg.org/lindenii/furgit/objectid" "codeberg.org/lindenii/furgit/objectstore" diff --git a/objectstore/packed/delta_build_chain.go b/objectstore/packed/delta_build_chain.go index 7a5f3c16..ece8018d 100644 --- a/objectstore/packed/delta_build_chain.go +++ b/objectstore/packed/delta_build_chain.go @@ -3,8 +3,8 @@ package packed import ( "fmt" - packfmt "codeberg.org/lindenii/furgit/format/pack" "codeberg.org/lindenii/furgit/objecttype" + packfmt "codeberg.org/lindenii/furgit/packfile" ) // deltaBuildChain walks one object's chain and builds a reconstruction chain. diff --git a/objectstore/packed/delta_resolve_chain.go b/objectstore/packed/delta_resolve_chain.go index e12bda88..04dca82e 100644 --- a/objectstore/packed/delta_resolve_chain.go +++ b/objectstore/packed/delta_resolve_chain.go @@ -3,7 +3,7 @@ package packed import ( "fmt" - deltaapply "codeberg.org/lindenii/furgit/format/delta/apply" + deltaapply "codeberg.org/lindenii/furgit/delta/apply" "codeberg.org/lindenii/furgit/objecttype" ) diff --git a/objectstore/packed/delta_resolve_chain_start.go b/objectstore/packed/delta_resolve_chain_start.go index 70266565..ce4ec0a1 100644 --- a/objectstore/packed/delta_resolve_chain_start.go +++ b/objectstore/packed/delta_resolve_chain_start.go @@ -3,8 +3,8 @@ package packed import ( "fmt" - packfmt "codeberg.org/lindenii/furgit/format/pack" "codeberg.org/lindenii/furgit/objecttype" + packfmt "codeberg.org/lindenii/furgit/packfile" ) // deltaResolveChainStart finds the nearest cached chain node or inflates the diff --git a/objectstore/packed/delta_resolve_content.go b/objectstore/packed/delta_resolve_content.go index a8de9cbc..ec4d7475 100644 --- a/objectstore/packed/delta_resolve_content.go +++ b/objectstore/packed/delta_resolve_content.go @@ -1,8 +1,8 @@ package packed import ( - packfmt "codeberg.org/lindenii/furgit/format/pack" "codeberg.org/lindenii/furgit/objecttype" + packfmt "codeberg.org/lindenii/furgit/packfile" ) // deltaResolveContent resolves one object's content bytes from its pack location. diff --git a/objectstore/packed/delta_size.go b/objectstore/packed/delta_size.go index ca0ccb25..4c89733c 100644 --- a/objectstore/packed/delta_size.go +++ b/objectstore/packed/delta_size.go @@ -3,7 +3,7 @@ package packed import ( "bufio" - deltaapply "codeberg.org/lindenii/furgit/format/delta/apply" + deltaapply "codeberg.org/lindenii/furgit/delta/apply" ) // deltaDeclaredSizeAt returns the resolved object size declared by one delta diff --git a/objectstore/packed/entry_parse.go b/objectstore/packed/entry_parse.go index 7af20af1..f89bc2a2 100644 --- a/objectstore/packed/entry_parse.go +++ b/objectstore/packed/entry_parse.go @@ -3,10 +3,10 @@ package packed import ( "fmt" - packfmt "codeberg.org/lindenii/furgit/format/pack" "codeberg.org/lindenii/furgit/internal/intconv" "codeberg.org/lindenii/furgit/objectid" "codeberg.org/lindenii/furgit/objecttype" + packfmt "codeberg.org/lindenii/furgit/packfile" ) // entryMeta describes one parsed pack entry header. diff --git a/objectstore/packed/pack.go b/objectstore/packed/pack.go index 874b2b76..c384d6a5 100644 --- a/objectstore/packed/pack.go +++ b/objectstore/packed/pack.go @@ -6,8 +6,8 @@ import ( "os" "syscall" - packfmt "codeberg.org/lindenii/furgit/format/pack" "codeberg.org/lindenii/furgit/internal/intconv" + packfmt "codeberg.org/lindenii/furgit/packfile" ) // packFile stores one mapped and validated .pack file. diff --git a/objectstore/packed/read_header_resolve.go b/objectstore/packed/read_header_resolve.go index 420d9363..1e660e62 100644 --- a/objectstore/packed/read_header_resolve.go +++ b/objectstore/packed/read_header_resolve.go @@ -3,8 +3,8 @@ package packed import ( "fmt" - packfmt "codeberg.org/lindenii/furgit/format/pack" "codeberg.org/lindenii/furgit/objecttype" + packfmt "codeberg.org/lindenii/furgit/packfile" ) // resolveHeaderAt resolves one object's canonical type and declared content size. diff --git a/objectstore/packed/read_reader.go b/objectstore/packed/read_reader.go index d5a94482..cbecaf2c 100644 --- a/objectstore/packed/read_reader.go +++ b/objectstore/packed/read_reader.go @@ -5,11 +5,11 @@ import ( "fmt" "io" - packfmt "codeberg.org/lindenii/furgit/format/pack" "codeberg.org/lindenii/furgit/internal/iolimit" "codeberg.org/lindenii/furgit/objectheader" "codeberg.org/lindenii/furgit/objectid" "codeberg.org/lindenii/furgit/objecttype" + packfmt "codeberg.org/lindenii/furgit/packfile" ) // ReadReaderContent reads an object's type, declared content size, and content stream. diff --git a/objectstore/packed/read_size.go b/objectstore/packed/read_size.go index a0a75db7..8581b01b 100644 --- a/objectstore/packed/read_size.go +++ b/objectstore/packed/read_size.go @@ -3,9 +3,9 @@ package packed import ( "fmt" - packfmt "codeberg.org/lindenii/furgit/format/pack" "codeberg.org/lindenii/furgit/objectid" "codeberg.org/lindenii/furgit/objecttype" + packfmt "codeberg.org/lindenii/furgit/packfile" ) // ReadSize reads an object's declared content size. diff --git a/format/pack/entry.go b/packfile/entry.go index 93d232a2..c17fe619 100644 --- a/format/pack/entry.go +++ b/packfile/entry.go @@ -20,7 +20,7 @@ type EntryHeader struct { func ParseEntryHeader(data []byte) (EntryHeader, error) { var zero EntryHeader if len(data) == 0 { - return zero, fmt.Errorf("format/pack: truncated entry header") + return zero, fmt.Errorf("packfile: truncated entry header") } first := data[0] @@ -35,7 +35,7 @@ func ParseEntryHeader(data []byte) (EntryHeader, error) { b := first for b&0x80 != 0 { if header.HeaderSize >= len(data) { - return zero, fmt.Errorf("format/pack: truncated entry header") + return zero, fmt.Errorf("packfile: truncated entry header") } b = data[header.HeaderSize] @@ -45,7 +45,7 @@ func ParseEntryHeader(data []byte) (EntryHeader, error) { } if header.Size < 0 { - return zero, fmt.Errorf("format/pack: negative entry size") + return zero, fmt.Errorf("packfile: negative entry size") } return header, nil @@ -89,12 +89,12 @@ func ParseEntry(data []byte, hashSize int) (Entry, error) { // Base object entries have no extra prefix fields. case objecttype.TypeRefDelta: if hashSize <= 0 { - return zero, fmt.Errorf("format/pack: invalid hash size %d", hashSize) + return zero, fmt.Errorf("packfile: invalid hash size %d", hashSize) } end := entry.DataOffset + hashSize if end > len(data) { - return zero, fmt.Errorf("format/pack: truncated ref-delta base id") + return zero, fmt.Errorf("packfile: truncated ref-delta base id") } entry.RefBaseID = data[entry.DataOffset:end] @@ -108,13 +108,13 @@ func ParseEntry(data []byte, hashSize int) (Entry, error) { entry.OfsBaseDistance = dist entry.DataOffset += consumed case objecttype.TypeInvalid, objecttype.TypeFuture: - return zero, fmt.Errorf("format/pack: unsupported object type %d", entry.Type) + return zero, fmt.Errorf("packfile: unsupported object type %d", entry.Type) default: - return zero, fmt.Errorf("format/pack: unsupported object type %d", entry.Type) + return zero, fmt.Errorf("packfile: unsupported object type %d", entry.Type) } if entry.DataOffset > len(data) { - return zero, fmt.Errorf("format/pack: entry data offset out of bounds") + return zero, fmt.Errorf("packfile: entry data offset out of bounds") } return entry, nil diff --git a/format/pack/ingest/api.go b/packfile/ingest/api.go index 5df09213..040e8d77 100644 --- a/format/pack/ingest/api.go +++ b/packfile/ingest/api.go @@ -172,7 +172,7 @@ func (pending *Pending) Discard() (DiscardResult, error) { n, err := pending.reader.Read(probe[:]) if n > 0 || err == nil { - return DiscardResult{}, errors.New("format/pack/ingest: pack has trailing garbage") + return DiscardResult{}, errors.New("packfile/ingest: pack has trailing garbage") } if err != io.EOF { diff --git a/format/pack/ingest/byteslice_reader.go b/packfile/ingest/byteslice_reader.go index a1570ef3..a1570ef3 100644 --- a/format/pack/ingest/byteslice_reader.go +++ b/packfile/ingest/byteslice_reader.go diff --git a/format/pack/ingest/cache.go b/packfile/ingest/cache.go index 3b4bf31a..3b4bf31a 100644 --- a/format/pack/ingest/cache.go +++ b/packfile/ingest/cache.go diff --git a/format/pack/ingest/counting_writer.go b/packfile/ingest/counting_writer.go index 051ad9d1..051ad9d1 100644 --- a/format/pack/ingest/counting_writer.go +++ b/packfile/ingest/counting_writer.go diff --git a/format/pack/ingest/crc.go b/packfile/ingest/crc.go index 35fa6952..f55af4ff 100644 --- a/format/pack/ingest/crc.go +++ b/packfile/ingest/crc.go @@ -11,7 +11,7 @@ func (scanner *streamScanner) beginEntryCRC() { // endEntryCRC finishes inline CRC accumulation for one packed entry. func (scanner *streamScanner) endEntryCRC() (uint32, error) { if !scanner.inEntryCRC { - return 0, fmt.Errorf("format/pack/ingest: entry CRC not started") + return 0, fmt.Errorf("packfile/ingest: entry CRC not started") } crc := scanner.entryCRC diff --git a/format/pack/ingest/delta_header.go b/packfile/ingest/delta_header.go index 4ecbea1b..76e90172 100644 --- a/format/pack/ingest/delta_header.go +++ b/packfile/ingest/delta_header.go @@ -1,6 +1,6 @@ package ingest -import deltaapply "codeberg.org/lindenii/furgit/format/delta/apply" +import deltaapply "codeberg.org/lindenii/furgit/delta/apply" // finalizeStreamPackHash consumes trailer bytes and verifies stream integrity. // readDeltaHeaderSizes reads source and destination sizes from one delta payload. diff --git a/format/pack/ingest/distance.go b/packfile/ingest/distance.go index 9bc4d886..9bc4d886 100644 --- a/format/pack/ingest/distance.go +++ b/packfile/ingest/distance.go diff --git a/format/pack/ingest/doc.go b/packfile/ingest/doc.go index 2095068a..2095068a 100644 --- a/format/pack/ingest/doc.go +++ b/packfile/ingest/doc.go diff --git a/format/pack/ingest/drain.go b/packfile/ingest/drain.go index 13e276bd..ce04fcb4 100644 --- a/format/pack/ingest/drain.go +++ b/packfile/ingest/drain.go @@ -4,11 +4,11 @@ import ( "fmt" "io" - packfmt "codeberg.org/lindenii/furgit/format/pack" "codeberg.org/lindenii/furgit/internal/compress/zlib" "codeberg.org/lindenii/furgit/objectheader" "codeberg.org/lindenii/furgit/objectid" "codeberg.org/lindenii/furgit/objecttype" + packfmt "codeberg.org/lindenii/furgit/packfile" ) // drainEntryPayload inflates one entry payload from stream and returns diff --git a/format/pack/ingest/entry.go b/packfile/ingest/entry.go index 5d22ada2..01be318d 100644 --- a/format/pack/ingest/entry.go +++ b/packfile/ingest/entry.go @@ -3,8 +3,8 @@ package ingest import ( "fmt" - packfmt "codeberg.org/lindenii/furgit/format/pack" "codeberg.org/lindenii/furgit/objecttype" + packfmt "codeberg.org/lindenii/furgit/packfile" ) // scanOneEntry scans one pack entry from stream and appends one record. diff --git a/format/pack/ingest/entry_header.go b/packfile/ingest/entry_header.go index 54f63fac..54f63fac 100644 --- a/format/pack/ingest/entry_header.go +++ b/packfile/ingest/entry_header.go diff --git a/format/pack/ingest/entry_prefix.go b/packfile/ingest/entry_prefix.go index 85493798..85493798 100644 --- a/format/pack/ingest/entry_prefix.go +++ b/packfile/ingest/entry_prefix.go diff --git a/format/pack/ingest/errors.go b/packfile/ingest/errors.go index d5e6d703..6292d790 100644 --- a/format/pack/ingest/errors.go +++ b/packfile/ingest/errors.go @@ -12,7 +12,7 @@ type InvalidPackHeaderError struct { // Error implements error. func (err *InvalidPackHeaderError) Error() string { - return "format/pack/ingest: invalid pack header: " + err.Reason + return "packfile/ingest: invalid pack header: " + err.Reason } // PackTrailerMismatchError reports a mismatch between computed and trailer pack hash. @@ -20,7 +20,7 @@ type PackTrailerMismatchError struct{} // Error implements error. func (err *PackTrailerMismatchError) Error() string { - return "format/pack/ingest: pack trailer hash mismatch" + return "packfile/ingest: pack trailer hash mismatch" } // ThinPackUnresolvedError reports unresolved REF deltas when fixThin is disabled @@ -31,7 +31,7 @@ type ThinPackUnresolvedError struct { // Error implements error. func (err *ThinPackUnresolvedError) Error() string { - return fmt.Sprintf("format/pack/ingest: unresolved thin deltas: %d", err.Count) + return fmt.Sprintf("packfile/ingest: unresolved thin deltas: %d", err.Count) } // MalformedPackEntryError reports malformed entry encoding at one pack offset. @@ -42,7 +42,7 @@ type MalformedPackEntryError struct { // Error implements error. func (err *MalformedPackEntryError) Error() string { - return fmt.Sprintf("format/pack/ingest: malformed pack entry at offset %d: %s", err.Offset, err.Reason) + return fmt.Sprintf("packfile/ingest: malformed pack entry at offset %d: %s", err.Offset, err.Reason) } // DeltaCycleError reports a detected cycle in delta dependency resolution. @@ -52,7 +52,7 @@ type DeltaCycleError struct { // Error implements error. func (err *DeltaCycleError) Error() string { - return fmt.Sprintf("format/pack/ingest: delta cycle detected at offset %d", err.Offset) + return fmt.Sprintf("packfile/ingest: delta cycle detected at offset %d", err.Offset) } // DestinationWriteError reports destination I/O failures. @@ -62,16 +62,16 @@ type DestinationWriteError struct { // Error implements error. func (err *DestinationWriteError) Error() string { - return "format/pack/ingest: destination write failure: " + err.Op + return "packfile/ingest: destination write failure: " + err.Op } -var errExternalThinBase = errors.New("format/pack/ingest: external thin base required") +var errExternalThinBase = errors.New("packfile/ingest: external thin base required") var ( // ErrAlreadyFinalized indicates Continue/Discard already called. - ErrAlreadyFinalized = errors.New("format/pack/ingest: operation already finalized") + ErrAlreadyFinalized = errors.New("packfile/ingest: operation already finalized") // ErrZeroObjectContinue indicates Continue was called for a zero-object pack. - ErrZeroObjectContinue = errors.New("format/pack/ingest: cannot continue zero-object pack") + ErrZeroObjectContinue = errors.New("packfile/ingest: cannot continue zero-object pack") // ErrNonZeroDiscard indicates Discard was called for a non-zero-object pack. - ErrNonZeroDiscard = errors.New("format/pack/ingest: cannot discard non-zero pack") + ErrNonZeroDiscard = errors.New("packfile/ingest: cannot discard non-zero pack") ) diff --git a/format/pack/ingest/file_section_writer.go b/packfile/ingest/file_section_writer.go index fa28c1a9..fa28c1a9 100644 --- a/format/pack/ingest/file_section_writer.go +++ b/packfile/ingest/file_section_writer.go diff --git a/format/pack/ingest/fill.go b/packfile/ingest/fill.go index 76fc6e60..eca4e4d6 100644 --- a/format/pack/ingest/fill.go +++ b/packfile/ingest/fill.go @@ -13,7 +13,7 @@ func (scanner *streamScanner) fill(minLen int) error { } if minLen > len(scanner.buf) { - return fmt.Errorf("format/pack/ingest: fill(%d) exceeds scanner buffer", minLen) + return fmt.Errorf("packfile/ingest: fill(%d) exceeds scanner buffer", minLen) } for scanner.n-scanner.off < minLen { diff --git a/format/pack/ingest/finalize.go b/packfile/ingest/finalize.go index e4dbe72f..6fe4edb2 100644 --- a/format/pack/ingest/finalize.go +++ b/packfile/ingest/finalize.go @@ -70,11 +70,11 @@ func rollbackTemporaryArtifacts(state *ingestState) { // linkTempToFinal hard-links tmp to final, tolerating existing final paths. func linkTempToFinal(state *ingestState, tmp, final string) error { if tmp == "" || final == "" { - return fmt.Errorf("format/pack/ingest: invalid finalize names tmp=%q final=%q", tmp, final) + return fmt.Errorf("packfile/ingest: invalid finalize names tmp=%q final=%q", tmp, final) } if strings.Contains(final, "/") { - return fmt.Errorf("format/pack/ingest: final name must be leaf: %q", final) + return fmt.Errorf("packfile/ingest: final name must be leaf: %q", final) } err := state.destination.Link(tmp, final) diff --git a/format/pack/ingest/flush.go b/packfile/ingest/flush.go index 96753170..96753170 100644 --- a/format/pack/ingest/flush.go +++ b/packfile/ingest/flush.go diff --git a/format/pack/ingest/hash.go b/packfile/ingest/hash.go index 8d4dac21..83df55c5 100644 --- a/format/pack/ingest/hash.go +++ b/packfile/ingest/hash.go @@ -12,7 +12,7 @@ import ( func hashCanonicalObject(algo objectid.Algorithm, ty objecttype.Type, content []byte) (objectid.ObjectID, error) { header, ok := objectheader.Encode(ty, int64(len(content))) if !ok { - return objectid.ObjectID{}, fmt.Errorf("format/pack/ingest: encode object header for type %d", ty) + return objectid.ObjectID{}, fmt.Errorf("packfile/ingest: encode object header for type %d", ty) } hashImpl, err := algo.New() diff --git a/format/pack/ingest/header.go b/packfile/ingest/header.go index 76d43bef..3e64fa57 100644 --- a/format/pack/ingest/header.go +++ b/packfile/ingest/header.go @@ -5,7 +5,7 @@ import ( "fmt" "io" - "codeberg.org/lindenii/furgit/format/pack" + "codeberg.org/lindenii/furgit/packfile" ) const packHeaderSize = 12 diff --git a/format/pack/ingest/idx_write.go b/packfile/ingest/idx_write.go index 922213d6..506788b9 100644 --- a/format/pack/ingest/idx_write.go +++ b/packfile/ingest/idx_write.go @@ -243,7 +243,7 @@ func buildIdxOrder(state *ingestState) []int { func verifyResolvedRecords(state *ingestState) error { for idx, record := range state.records { if !record.resolved { - return fmt.Errorf("format/pack/ingest: unresolved record %d at offset %d", idx, record.offset) + return fmt.Errorf("packfile/ingest: unresolved record %d at offset %d", idx, record.offset) } } diff --git a/format/pack/ingest/ingest.go b/packfile/ingest/ingest.go index be65ff5f..be65ff5f 100644 --- a/format/pack/ingest/ingest.go +++ b/packfile/ingest/ingest.go diff --git a/format/pack/ingest/ingest_test.go b/packfile/ingest/ingest_test.go index 95b6643c..4e0cd3ec 100644 --- a/format/pack/ingest/ingest_test.go +++ b/packfile/ingest/ingest_test.go @@ -11,9 +11,9 @@ import ( "strings" "testing" - "codeberg.org/lindenii/furgit/format/pack/ingest" "codeberg.org/lindenii/furgit/internal/testgit" "codeberg.org/lindenii/furgit/objectid" + "codeberg.org/lindenii/furgit/packfile/ingest" ) type noExtraReadReader struct { diff --git a/format/pack/ingest/progress_write.go b/packfile/ingest/progress_write.go index 5b9f184b..5b9f184b 100644 --- a/format/pack/ingest/progress_write.go +++ b/packfile/ingest/progress_write.go diff --git a/format/pack/ingest/record_content.go b/packfile/ingest/record_content.go index 8fef44b9..05972b22 100644 --- a/format/pack/ingest/record_content.go +++ b/packfile/ingest/record_content.go @@ -3,15 +3,15 @@ package ingest import ( "fmt" - packfmt "codeberg.org/lindenii/furgit/format/pack" "codeberg.org/lindenii/furgit/objecttype" + packfmt "codeberg.org/lindenii/furgit/packfile" ) // readBaseRecordContent reads canonical base content for one non-delta record. func readBaseRecordContent(state *ingestState, idx int) (objecttype.Type, []byte, error) { record := state.records[idx] if !packfmt.IsBaseObjectType(record.packedType) { - return objecttype.TypeInvalid, nil, fmt.Errorf("format/pack/ingest: record %d is not a base object", idx) + return objecttype.TypeInvalid, nil, fmt.Errorf("packfile/ingest: record %d is not a base object", idx) } content, err := inflateRecordPayload(state, idx) diff --git a/format/pack/ingest/record_delta.go b/packfile/ingest/record_delta.go index 4a3d5810..a28fcabc 100644 --- a/format/pack/ingest/record_delta.go +++ b/packfile/ingest/record_delta.go @@ -3,7 +3,7 @@ package ingest import ( "fmt" - deltaapply "codeberg.org/lindenii/furgit/format/delta/apply" + deltaapply "codeberg.org/lindenii/furgit/delta/apply" "codeberg.org/lindenii/furgit/objecttype" ) @@ -11,7 +11,7 @@ import ( func applyDeltaRecord(state *ingestState, idx int, baseType objecttype.Type, baseContent []byte) (objecttype.Type, []byte, error) { record := state.records[idx] if record.packedType != objecttype.TypeOfsDelta && record.packedType != objecttype.TypeRefDelta { - return objecttype.TypeInvalid, nil, fmt.Errorf("format/pack/ingest: record %d is not a delta record", idx) + return objecttype.TypeInvalid, nil, fmt.Errorf("packfile/ingest: record %d is not a delta record", idx) } deltaPayload, err := inflateRecordPayload(state, idx) diff --git a/format/pack/ingest/record_inflate.go b/packfile/ingest/record_inflate.go index b8eca25b..b8eca25b 100644 --- a/format/pack/ingest/record_inflate.go +++ b/packfile/ingest/record_inflate.go diff --git a/format/pack/ingest/record_resolve.go b/packfile/ingest/record_resolve.go index fad8ee7f..1eec1858 100644 --- a/format/pack/ingest/record_resolve.go +++ b/packfile/ingest/record_resolve.go @@ -3,14 +3,14 @@ package ingest import ( "fmt" - packfmt "codeberg.org/lindenii/furgit/format/pack" "codeberg.org/lindenii/furgit/objecttype" + packfmt "codeberg.org/lindenii/furgit/packfile" ) // resolveRecord resolves one record and returns canonical type/content. func resolveRecord(state *ingestState, idx int, visiting map[int]struct{}) (objecttype.Type, []byte, error) { if idx < 0 || idx >= len(state.records) { - return objecttype.TypeInvalid, nil, fmt.Errorf("format/pack/ingest: record index out of bounds") + return objecttype.TypeInvalid, nil, fmt.Errorf("packfile/ingest: record index out of bounds") } if _, ok := visiting[idx]; ok { diff --git a/format/pack/ingest/records.go b/packfile/ingest/records.go index 06b7f708..06b7f708 100644 --- a/format/pack/ingest/records.go +++ b/packfile/ingest/records.go diff --git a/format/pack/ingest/resolve_all.go b/packfile/ingest/resolve_all.go index e0ad2281..e0ad2281 100644 --- a/format/pack/ingest/resolve_all.go +++ b/packfile/ingest/resolve_all.go diff --git a/format/pack/ingest/rev_write.go b/packfile/ingest/rev_write.go index f8c30c1b..f8c30c1b 100644 --- a/format/pack/ingest/rev_write.go +++ b/packfile/ingest/rev_write.go diff --git a/format/pack/ingest/rewrite_header_trailer.go b/packfile/ingest/rewrite_header_trailer.go index c5f858de..c5f858de 100644 --- a/format/pack/ingest/rewrite_header_trailer.go +++ b/packfile/ingest/rewrite_header_trailer.go diff --git a/format/pack/ingest/scan.go b/packfile/ingest/scan.go index d26653a8..41916cdf 100644 --- a/format/pack/ingest/scan.go +++ b/packfile/ingest/scan.go @@ -50,7 +50,7 @@ func streamPackAndScan(state *ingestState) error { } if nextOffset != state.stream.consumed { - return fmt.Errorf("format/pack/ingest: internal stream offset mismatch") + return fmt.Errorf("packfile/ingest: internal stream offset mismatch") } done := i + 1 @@ -65,7 +65,7 @@ func streamPackAndScan(state *ingestState) error { } if len(state.stream.packTrailer) != state.algo.Size() { - return fmt.Errorf("format/pack/ingest: invalid trailer size") + return fmt.Errorf("packfile/ingest: invalid trailer size") } packHash, err := objectid.FromBytes(state.algo, state.stream.packTrailer) diff --git a/format/pack/ingest/state.go b/packfile/ingest/state.go index d44b6e09..d44b6e09 100644 --- a/format/pack/ingest/state.go +++ b/packfile/ingest/state.go diff --git a/format/pack/ingest/stream.go b/packfile/ingest/stream.go index a403087a..a403087a 100644 --- a/format/pack/ingest/stream.go +++ b/packfile/ingest/stream.go diff --git a/format/pack/ingest/temp.go b/packfile/ingest/temp.go index 2f898609..d0b7862c 100644 --- a/format/pack/ingest/temp.go +++ b/packfile/ingest/temp.go @@ -96,8 +96,8 @@ func createTempFile(root *os.Root, prefix string) (string, *os.File, error) { continue } - return "", nil, fmt.Errorf("format/pack/ingest: create temp file %q: %w", name, err) + return "", nil, fmt.Errorf("packfile/ingest: create temp file %q: %w", name, err) } - return "", nil, fmt.Errorf("format/pack/ingest: unable to create temporary file for prefix %q", prefix) + return "", nil, fmt.Errorf("packfile/ingest: unable to create temporary file for prefix %q", prefix) } diff --git a/format/pack/ingest/testdata/fixtures/sha1/METADATA.txt b/packfile/ingest/testdata/fixtures/sha1/METADATA.txt index 5fcbfe26..5fcbfe26 100644 --- a/format/pack/ingest/testdata/fixtures/sha1/METADATA.txt +++ b/packfile/ingest/testdata/fixtures/sha1/METADATA.txt diff --git a/format/pack/ingest/testdata/fixtures/sha1/base.pack b/packfile/ingest/testdata/fixtures/sha1/base.pack Binary files differindex 3d7a4903..3d7a4903 100644 --- a/format/pack/ingest/testdata/fixtures/sha1/base.pack +++ b/packfile/ingest/testdata/fixtures/sha1/base.pack diff --git a/format/pack/ingest/testdata/fixtures/sha1/nonthin.pack b/packfile/ingest/testdata/fixtures/sha1/nonthin.pack Binary files differindex ea07c9a0..ea07c9a0 100644 --- a/format/pack/ingest/testdata/fixtures/sha1/nonthin.pack +++ b/packfile/ingest/testdata/fixtures/sha1/nonthin.pack diff --git a/format/pack/ingest/testdata/fixtures/sha1/thin.pack b/packfile/ingest/testdata/fixtures/sha1/thin.pack Binary files differindex 95084feb..95084feb 100644 --- a/format/pack/ingest/testdata/fixtures/sha1/thin.pack +++ b/packfile/ingest/testdata/fixtures/sha1/thin.pack diff --git a/format/pack/ingest/testdata/fixtures/sha256/METADATA.txt b/packfile/ingest/testdata/fixtures/sha256/METADATA.txt index 8a5ea0a2..8a5ea0a2 100644 --- a/format/pack/ingest/testdata/fixtures/sha256/METADATA.txt +++ b/packfile/ingest/testdata/fixtures/sha256/METADATA.txt diff --git a/format/pack/ingest/testdata/fixtures/sha256/base.pack b/packfile/ingest/testdata/fixtures/sha256/base.pack Binary files differindex 52ceef74..52ceef74 100644 --- a/format/pack/ingest/testdata/fixtures/sha256/base.pack +++ b/packfile/ingest/testdata/fixtures/sha256/base.pack diff --git a/format/pack/ingest/testdata/fixtures/sha256/nonthin.pack b/packfile/ingest/testdata/fixtures/sha256/nonthin.pack Binary files differindex 50db05d0..50db05d0 100644 --- a/format/pack/ingest/testdata/fixtures/sha256/nonthin.pack +++ b/packfile/ingest/testdata/fixtures/sha256/nonthin.pack diff --git a/format/pack/ingest/testdata/fixtures/sha256/thin.pack b/packfile/ingest/testdata/fixtures/sha256/thin.pack Binary files differindex b331b915..b331b915 100644 --- a/format/pack/ingest/testdata/fixtures/sha256/thin.pack +++ b/packfile/ingest/testdata/fixtures/sha256/thin.pack diff --git a/format/pack/ingest/thin_append.go b/packfile/ingest/thin_append.go index 161f00a9..161f00a9 100644 --- a/format/pack/ingest/thin_append.go +++ b/packfile/ingest/thin_append.go diff --git a/format/pack/ingest/thin_fix.go b/packfile/ingest/thin_fix.go index f33f7b50..f94d8c0b 100644 --- a/format/pack/ingest/thin_fix.go +++ b/packfile/ingest/thin_fix.go @@ -38,7 +38,7 @@ func maybeFixThin(state *ingestState) error { size := info.Size() if size < hashSize { - return fmt.Errorf("format/pack/ingest: pack too short to trim trailer") + return fmt.Errorf("packfile/ingest: pack too short to trim trailer") } newEnd := size - hashSize @@ -75,7 +75,7 @@ func maybeFixThin(state *ingestState) error { continue } - return fmt.Errorf("format/pack/ingest: read thin base %s: %w", id, err) + return fmt.Errorf("packfile/ingest: read thin base %s: %w", id, err) } _, err = appendBaseObject(state, id, ty, content) diff --git a/format/pack/ingest/thin_unresolved.go b/packfile/ingest/thin_unresolved.go index 347f3f29..347f3f29 100644 --- a/format/pack/ingest/thin_unresolved.go +++ b/packfile/ingest/thin_unresolved.go diff --git a/format/pack/ingest/trailer.go b/packfile/ingest/trailer.go index 30ba3bb8..7a26a8f2 100644 --- a/format/pack/ingest/trailer.go +++ b/packfile/ingest/trailer.go @@ -11,7 +11,7 @@ import ( // and optionally requires the source stream to hit EOF afterward. func (scanner *streamScanner) finishAndFlushTrailer(requireTrailingEOF bool) error { if scanner.hashSize <= 0 { - return fmt.Errorf("format/pack/ingest: invalid hash size") + return fmt.Errorf("packfile/ingest: invalid hash size") } trailer := make([]byte, scanner.hashSize) @@ -26,7 +26,7 @@ func (scanner *streamScanner) finishAndFlushTrailer(requireTrailingEOF bool) err scanner.packTrailer = append(scanner.packTrailer[:0], trailer...) if scanner.n-scanner.off > 0 { - return fmt.Errorf("format/pack/ingest: pack has trailing garbage") + return fmt.Errorf("packfile/ingest: pack has trailing garbage") } if !requireTrailingEOF { @@ -42,7 +42,7 @@ func (scanner *streamScanner) finishAndFlushTrailer(requireTrailingEOF bool) err n, err := scanner.Read(probe[:]) if n > 0 || err == nil { - return fmt.Errorf("format/pack/ingest: pack has trailing garbage") + return fmt.Errorf("packfile/ingest: pack has trailing garbage") } if !errors.Is(err, io.EOF) { diff --git a/format/pack/ingest/use.go b/packfile/ingest/use.go index 18fc6357..97f8757a 100644 --- a/format/pack/ingest/use.go +++ b/packfile/ingest/use.go @@ -8,7 +8,7 @@ import ( // use consumes n unread bytes and updates accounting/checksum state. func (scanner *streamScanner) use(n int) error { if n < 0 || n > scanner.n-scanner.off { - return fmt.Errorf("format/pack/ingest: invalid consume length %d", n) + return fmt.Errorf("packfile/ingest: invalid consume length %d", n) } if n == 0 { diff --git a/format/pack/pack.go b/packfile/pack.go index e87e3360..88d8fd9a 100644 --- a/format/pack/pack.go +++ b/packfile/pack.go @@ -31,7 +31,7 @@ func IsBaseObjectType(ty objecttype.Type) bool { // ParseOfsDeltaDistance parses one ofs-delta backward distance. func ParseOfsDeltaDistance(buf []byte) (uint64, int, error) { if len(buf) == 0 { - return 0, 0, fmt.Errorf("format/pack: malformed ofs-delta distance") + return 0, 0, fmt.Errorf("packfile: malformed ofs-delta distance") } b := buf[0] @@ -40,7 +40,7 @@ func ParseOfsDeltaDistance(buf []byte) (uint64, int, error) { consumed := 1 for b&0x80 != 0 { if consumed >= len(buf) { - return 0, 0, fmt.Errorf("format/pack: malformed ofs-delta distance") + return 0, 0, fmt.Errorf("packfile: malformed ofs-delta distance") } b = buf[consumed] diff --git a/protocol/v0v1/server/receivepack/parse_test.go b/protocol/v0v1/server/receivepack/parse_test.go index 40c67c98..d0fcfab6 100644 --- a/protocol/v0v1/server/receivepack/parse_test.go +++ b/protocol/v0v1/server/receivepack/parse_test.go @@ -5,9 +5,9 @@ import ( "strings" "testing" - "codeberg.org/lindenii/furgit/protocol/pktline" "codeberg.org/lindenii/furgit/internal/testgit" "codeberg.org/lindenii/furgit/objectid" + "codeberg.org/lindenii/furgit/protocol/pktline" common "codeberg.org/lindenii/furgit/protocol/v0v1/server" receivepack "codeberg.org/lindenii/furgit/protocol/v0v1/server/receivepack" ) diff --git a/protocol/v0v1/server/receivepack/report_status_test.go b/protocol/v0v1/server/receivepack/report_status_test.go index a81d45d0..383bc92e 100644 --- a/protocol/v0v1/server/receivepack/report_status_test.go +++ b/protocol/v0v1/server/receivepack/report_status_test.go @@ -6,10 +6,10 @@ import ( "strings" "testing" - "codeberg.org/lindenii/furgit/protocol/pktline" - "codeberg.org/lindenii/furgit/protocol/sideband64k" "codeberg.org/lindenii/furgit/internal/testgit" "codeberg.org/lindenii/furgit/objectid" + "codeberg.org/lindenii/furgit/protocol/pktline" + "codeberg.org/lindenii/furgit/protocol/sideband64k" common "codeberg.org/lindenii/furgit/protocol/v0v1/server" receivepack "codeberg.org/lindenii/furgit/protocol/v0v1/server/receivepack" ) diff --git a/protocol/v0v1/server/session.go b/protocol/v0v1/server/session.go index d3267d10..14f8a5de 100644 --- a/protocol/v0v1/server/session.go +++ b/protocol/v0v1/server/session.go @@ -3,9 +3,9 @@ package server import ( "io" + "codeberg.org/lindenii/furgit/objectid" "codeberg.org/lindenii/furgit/protocol/pktline" "codeberg.org/lindenii/furgit/protocol/sideband64k" - "codeberg.org/lindenii/furgit/objectid" ) // Options configures one server-side v0/v1 session. diff --git a/receivepack/int_test.go b/receivepack/int_test.go index 4db020a4..b44bc2b8 100644 --- a/receivepack/int_test.go +++ b/receivepack/int_test.go @@ -9,10 +9,10 @@ import ( "testing" "time" - "codeberg.org/lindenii/furgit/protocol/pktline" - "codeberg.org/lindenii/furgit/protocol/sideband64k" "codeberg.org/lindenii/furgit/internal/testgit" "codeberg.org/lindenii/furgit/objectid" + "codeberg.org/lindenii/furgit/protocol/pktline" + "codeberg.org/lindenii/furgit/protocol/sideband64k" receivepack "codeberg.org/lindenii/furgit/receivepack" receivepackhooks "codeberg.org/lindenii/furgit/receivepack/hooks" ) diff --git a/receivepack/service/ingest_quarantine.go b/receivepack/service/ingest_quarantine.go index 5b2b706b..8e3e2455 100644 --- a/receivepack/service/ingest_quarantine.go +++ b/receivepack/service/ingest_quarantine.go @@ -3,8 +3,8 @@ package service import ( "os" - "codeberg.org/lindenii/furgit/format/pack/ingest" "codeberg.org/lindenii/furgit/internal/utils" + "codeberg.org/lindenii/furgit/packfile/ingest" ) func (service *Service) ingestQuarantine( diff --git a/receivepack/service/result.go b/receivepack/service/result.go index 7db7dcb1..17fc0b6b 100644 --- a/receivepack/service/result.go +++ b/receivepack/service/result.go @@ -1,7 +1,7 @@ package service import ( - "codeberg.org/lindenii/furgit/format/pack/ingest" + "codeberg.org/lindenii/furgit/packfile/ingest" ) // Result is one receive-pack execution result. |
