Skip to content
This repository has been archived by the owner on Sep 11, 2020. It is now read-only.

Commit

Permalink
Do not treat delta references as small objects that can be eagerly lo…
Browse files Browse the repository at this point in the history
…aded.

Signed-off-by: Filip Navara <[email protected]>
  • Loading branch information
filipnavara committed Nov 26, 2018
1 parent 4cb21e2 commit 3c36f7a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion plumbing/format/packfile/packfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,14 @@ func (p *Packfile) objectAtOffset(offset int64) (plumbing.EncodedObject, error)

// If we have no filesystem, we will return a MemoryObject instead
// of an FSObject.
if p.fs == nil || h.Length <= smallObjectThreshold {
if p.fs == nil {
return p.getNextObject(h)
}

// If the object is not a delta and it's small enough then read it
// completely into memory now since it is already read from disk
// into buffer anyway.
if h.Length <= smallObjectThreshold && h.Type != plumbing.OFSDeltaObject && h.Type != plumbing.REFDeltaObject {
return p.getNextObject(h)
}

Expand Down

0 comments on commit 3c36f7a

Please sign in to comment.