diff options
| author | 2026-02-20 12:41:02 +0800 | |
|---|---|---|
| committer | 2026-02-20 12:57:31 +0800 | |
| commit | b140f267b02b0a5466ec74427dba775da93d298c (patch) | |
| tree | 09206ab05dfb11c0d17bae475a18b154811e8659 /packed_write_pack.go | |
| parent | Revert "README: thin packs are supported now" (diff) | |
| signature | No signature | |
Revert "packed: Factor out packWriteObjects and clean up"
This reverts commit 06b3648782c860ac0bc096e30e72587d5016e4e4.
Diffstat (limited to 'packed_write_pack.go')
| -rw-r--r-- | packed_write_pack.go | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/packed_write_pack.go b/packed_write_pack.go index 504c1087..1d8cbc1e 100644 --- a/packed_write_pack.go +++ b/packed_write_pack.go @@ -3,12 +3,16 @@ package furgit import ( "crypto/rand" "encoding/binary" + "errors" "hash" "io" "codeberg.org/lindenii/furgit/internal/zlib" ) +// TODO +var errThinPackUnimplemented = errors.New("furgit: pack: thin packs not implemented") + // packWriter writes a PACKv2 stream. type packWriter struct { w io.Writer @@ -277,6 +281,14 @@ func packOfsEncode(dist uint64) ([]byte, error) { return out[:pos], nil } +// packWrite writes a pack stream for the provided object ids. +func (repo *Repository) packWrite(w io.Writer, objects []Hash, opts packWriteOptions) (Hash, error) { + if opts.EnableThinPack { + return Hash{}, errThinPackUnimplemented + } + return repo.packWriteObjects(w, objects, opts, nil) +} + // packWriteReachable writes a pack stream for objects reachable from the // provided reachability query. func (repo *Repository) packWriteReachable(w io.Writer, query ReachabilityQuery, opts packWriteOptions) (Hash, error) { @@ -295,11 +307,10 @@ func (repo *Repository) packWriteReachable(w io.Writer, query ReachabilityQuery, if err := walk.Err(); err != nil { return Hash{}, err } - return repo.packWrite(w, objects, opts, walk) + return repo.packWriteObjects(w, objects, opts, walk) } -// packWrite writes a pack stream for the provided object ids. -func (repo *Repository) packWrite(w io.Writer, objects []Hash, opts packWriteOptions, have *ReachabilityWalk) (Hash, error) { +func (repo *Repository) packWriteObjects(w io.Writer, objects []Hash, opts packWriteOptions, have *ReachabilityWalk) (Hash, error) { if repo == nil { return Hash{}, ErrInvalidObject } |
