aboutsummaryrefslogtreecommitdiff
path: root/packed_write_pack.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-01-30 17:15:49 +0100
committerGravatar Runxi Yu2026-01-30 17:15:49 +0100
commit06b3648782c860ac0bc096e30e72587d5016e4e4 (patch)
tree017f6170ea4a92e050d0ee31d41de968538b4c98 /packed_write_pack.go
parenttest: Make gitCmd accept an stdin []byte (diff)
signatureNo signature
packed: Factor out packWriteObjects and clean up
Diffstat (limited to 'packed_write_pack.go')
-rw-r--r--packed_write_pack.go17
1 files changed, 3 insertions, 14 deletions
diff --git a/packed_write_pack.go b/packed_write_pack.go
index 1d8cbc1e..504c1087 100644
--- a/packed_write_pack.go
+++ b/packed_write_pack.go
@@ -3,16 +3,12 @@ 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
@@ -281,14 +277,6 @@ 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) {
@@ -307,10 +295,11 @@ func (repo *Repository) packWriteReachable(w io.Writer, query ReachabilityQuery,
if err := walk.Err(); err != nil {
return Hash{}, err
}
- return repo.packWriteObjects(w, objects, opts, walk)
+ return repo.packWrite(w, objects, opts, walk)
}
-func (repo *Repository) packWriteObjects(w io.Writer, objects []Hash, opts packWriteOptions, have *ReachabilityWalk) (Hash, error) {
+// 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) {
if repo == nil {
return Hash{}, ErrInvalidObject
}