-
Notifications
You must be signed in to change notification settings - Fork 534
Conversation
return nil | ||
} | ||
|
||
func (dw *deltaSelector) fixAndBreakChainsOne(objectsToPack map[plumbing.Hash]*ObjectToPack, otp *ObjectToPack) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why One
? what does it means?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's one
because it processes just one ObjectToPack.
} | ||
|
||
do, ok := otp.Object.(plumbing.DeltaObject) | ||
if !ok { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1
} | ||
|
||
base, ok := objectsToPack[do.BaseHash()] | ||
if !ok { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2
return nil | ||
} | ||
|
||
if base.Size() <= otp.Size() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3
1,2 and 3 are almost identical pieces of code. Could you find a way to do not duplicate these code? I know that is plumbing code, difficult to improve, but we can try.
return nil | ||
} | ||
|
||
isDelta := otp.Object.Type() == plumbing.OFSDeltaObject || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a function.
* Improve checks for encode/decode. * Make it easier to extend this test with more storage backends.
Codecov Report
@@ Coverage Diff @@
## master #515 +/- ##
=========================================
- Coverage 78.28% 77.49% -0.8%
=========================================
Files 128 129 +1
Lines 9539 9685 +146
=========================================
+ Hits 7468 7505 +37
- Misses 1264 1368 +104
- Partials 807 812 +5
Continue to review full report at Codecov.
|
* plumbing: add DeltaObject interface for EncodedObjects that are deltas and hold additional information about them, such as the hash of the base object. * plumbing/storer: add DeltaObjectStorer interface for object storers that can return DeltaObject. Note that calls to EncodedObject will never return instances of DeltaObject. That requires explicit calls to DeltaObject. * storage/filesystem: implement DeltaObjectStorer interface. * plumbing/packfile: packfile encoder now supports reusing deltas that are already computed (e.g. from an existing packfile) if the storage implements DeltaObjectStorer. Reusing deltas boosts performance of packfile generation (e.g. on push).
ObjectType.IsDelta is a convenience function to match both offset and reference delta types.
plumbing: add DeltaObject interface for EncodedObjects that
are deltas and hold additional information about them, such
as the hash of the base object.
plumbing/storer: add DeltaObjectStorer interface for object
storers that can return DeltaObject. Note that calls to
EncodedObject will never return instances of DeltaObject.
That requires explicit calls to DeltaObject.
storage/filesystem: implement DeltaObjectStorer interface.
plumbing/packfile: packfile encoder now supports reusing
deltas that are already computed (e.g. from an existing
packfile) if the storage implements DeltaObjectStorer.
Reusing deltas boosts performance of packfile generation
(e.g. on push).