aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/format/packfile
diff options
context:
space:
mode:
authorSantiago M. Mola <santi@mola.io>2017-07-27 17:24:01 +0200
committerSantiago M. Mola <santi@mola.io>2017-07-27 17:24:01 +0200
commit16b24f84e9342234ad90da27a6532887b05d1965 (patch)
tree5e75e59f89b87988fd18e0258d32314e69a87292 /plumbing/format/packfile
parent87413ced43b02a41359ce7a1a07ab41aec6ee313 (diff)
downloadgo-git-16b24f84e9342234ad90da27a6532887b05d1965.tar.gz
plumbing: add IsDelta method to ObjectType
ObjectType.IsDelta is a convenience function to match both offset and reference delta types.
Diffstat (limited to 'plumbing/format/packfile')
-rw-r--r--plumbing/format/packfile/delta_selector.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/plumbing/format/packfile/delta_selector.go b/plumbing/format/packfile/delta_selector.go
index 4bee6d3..efcbd53 100644
--- a/plumbing/format/packfile/delta_selector.go
+++ b/plumbing/format/packfile/delta_selector.go
@@ -96,9 +96,7 @@ func (dw *deltaSelector) fixAndBreakChains(objectsToPack []*ObjectToPack) error
}
func (dw *deltaSelector) fixAndBreakChainsOne(objectsToPack map[plumbing.Hash]*ObjectToPack, otp *ObjectToPack) error {
- isDelta := otp.Object.Type() == plumbing.OFSDeltaObject ||
- otp.Object.Type() == plumbing.REFDeltaObject
- if !isDelta {
+ if !otp.Object.Type().IsDelta() {
return nil
}
@@ -141,9 +139,7 @@ func (dw *deltaSelector) restoreOriginal(otp *ObjectToPack) error {
return nil
}
- isDelta := otp.Object.Type() == plumbing.OFSDeltaObject ||
- otp.Object.Type() == plumbing.REFDeltaObject
- if !isDelta {
+ if !otp.Object.Type().IsDelta() {
return nil
}