aboutsummaryrefslogtreecommitdiffstats
path: root/formats
diff options
context:
space:
mode:
Diffstat (limited to 'formats')
-rw-r--r--formats/packfile/reader.go6
-rw-r--r--formats/pktline/decoder.go7
-rw-r--r--formats/pktline/doc.go4
-rw-r--r--formats/pktline/encoder.go1
4 files changed, 12 insertions, 6 deletions
diff --git a/formats/packfile/reader.go b/formats/packfile/reader.go
index a013776..3f7081b 100644
--- a/formats/packfile/reader.go
+++ b/formats/packfile/reader.go
@@ -22,7 +22,7 @@ var (
InvalidObjectErr = newError("invalid git object")
PatchingErr = newError("patching error")
PackEntryNotFoundErr = newError("can't find a pack entry")
- ObjectNotFoundErr = newError("can't find a object")
+ ErrObjectNotFound = newError("can't find a object")
ZLibErr = newError("zlib reading error")
)
@@ -200,8 +200,8 @@ func (r *Reader) readREFDelta(raw core.Object) (err error) {
referenced, err := r.s.Get(ref)
if err != nil {
- if err == core.ObjectNotFoundErr {
- return ObjectNotFoundErr.n("%s", ref)
+ if err == core.ErrObjectNotFound {
+ return ErrObjectNotFound.n("%s", ref)
}
return err
}
diff --git a/formats/pktline/decoder.go b/formats/pktline/decoder.go
index c30be6b..34e6f51 100644
--- a/formats/pktline/decoder.go
+++ b/formats/pktline/decoder.go
@@ -7,9 +7,12 @@ import (
)
var (
- ErrUnderflow = errors.New("unexpected string length (underflow)")
+ // ErrUnderflow is triggered when a line is shorter than the described length
+ ErrUnderflow = errors.New("unexpected string length (underflow)")
+ // ErrInvalidHeader invalid pktline header
ErrInvalidHeader = errors.New("invalid header")
- ErrInvalidLen = errors.New("invalid length")
+ // ErrInvalidLen ivanlid line length found, < 0
+ ErrInvalidLen = errors.New("invalid length")
)
// Decoder implements a pkt-line format decoder
diff --git a/formats/pktline/doc.go b/formats/pktline/doc.go
index 0ae22e3..555a073 100644
--- a/formats/pktline/doc.go
+++ b/formats/pktline/doc.go
@@ -51,6 +51,8 @@ package pktline
// https://github.com/git/git/blob/master/Documentation/technical/protocol-common.txt
const (
+ // HeaderLength length of the pktline header
HeaderLength = 4
- MaxLength = 65524
+ // MaxLength max line length
+ MaxLength = 65524
)
diff --git a/formats/pktline/encoder.go b/formats/pktline/encoder.go
index dfa53e2..bd0ab75 100644
--- a/formats/pktline/encoder.go
+++ b/formats/pktline/encoder.go
@@ -7,6 +7,7 @@ import (
)
var (
+ //ErrOverflow happends when the line length exceed the MaxLength
ErrOverflow = errors.New("unexpected string length (overflow)")
)