Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit adb810a

Browse files
committed
plumbing: add packWindow comments
1 parent 5d3dc69 commit adb810a

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

plumbing/format/packfile/delta_selector.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,11 @@ func newDeltaSelector(s storer.EncodedObjectStorer) *deltaSelector {
2828
return &deltaSelector{s}
2929
}
3030

31-
// ObjectsToPack creates a list of ObjectToPack from the hashes provided,
32-
// creating deltas if it's suitable, using an specific internal logic
31+
// ObjectsToPack creates a list of ObjectToPack from the hashes
32+
// provided, creating deltas if it's suitable, using an specific
33+
// internal logic. `packWindow` specifies the size of the sliding
34+
// window used to compare objects for delta compression; 0 turns off
35+
// delta compression entirely.
3336
func (dw *deltaSelector) ObjectsToPack(
3437
hashes []plumbing.Hash,
3538
packWindow uint,

plumbing/format/packfile/encoder.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ func NewEncoder(w io.Writer, s storer.EncodedObjectStorer, useRefDeltas bool) *E
4545
}
4646
}
4747

48-
// Encode creates a packfile containing all the objects referenced in hashes
49-
// and writes it to the writer in the Encoder.
48+
// Encode creates a packfile containing all the objects referenced in
49+
// hashes and writes it to the writer in the Encoder. `packWindow`
50+
// specifies the size of the sliding window used to compare objects
51+
// for delta compression; 0 turns off delta compression entirely.
5052
func (e *Encoder) Encode(
5153
hashes []plumbing.Hash,
5254
packWindow uint,

0 commit comments

Comments
 (0)