aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/format/packfile
diff options
context:
space:
mode:
authorSergio Arbeo <serabe@gmail.com>2017-01-30 19:04:46 +0100
committerMáximo Cuadros <mcuadros@gmail.com>2017-01-30 19:04:46 +0100
commit90c1bbd07862c6e1c3ce80306d69eee8ed277056 (patch)
tree5d24a7a015803fd2776b968b777ce5e017be9973 /plumbing/format/packfile
parenta24e40af0aa2d9d512051269993a1b08c0496d12 (diff)
downloadgo-git-90c1bbd07862c6e1c3ce80306d69eee8ed277056.tar.gz
Fix some typos in plumbing docs (#244)
Diffstat (limited to 'plumbing/format/packfile')
-rw-r--r--plumbing/format/packfile/common.go2
-rw-r--r--plumbing/format/packfile/decoder.go16
-rw-r--r--plumbing/format/packfile/diff_delta.go2
-rw-r--r--plumbing/format/packfile/encoder.go2
-rw-r--r--plumbing/format/packfile/patch_delta.go2
5 files changed, 12 insertions, 12 deletions
diff --git a/plumbing/format/packfile/common.go b/plumbing/format/packfile/common.go
index 7da2b33..6402cd0 100644
--- a/plumbing/format/packfile/common.go
+++ b/plumbing/format/packfile/common.go
@@ -20,7 +20,7 @@ const (
maskType = uint8(112) // 0111 0000
)
-// UpdateObjectStorage updates the given ObjectStorer with the contents of the
+// UpdateObjectStorage updates the given storer.EncodedObjectStorer with the contents of the
// packfile.
func UpdateObjectStorage(s storer.EncodedObjectStorer, packfile io.Reader) error {
if sw, ok := s.(storer.PackfileWriter); ok {
diff --git a/plumbing/format/packfile/decoder.go b/plumbing/format/packfile/decoder.go
index 5793fdd..f206350 100644
--- a/plumbing/format/packfile/decoder.go
+++ b/plumbing/format/packfile/decoder.go
@@ -49,7 +49,7 @@ var (
// Decoder reads and decodes packfiles from an input Scanner, if an ObjectStorer
// was provided the decoded objects are store there. If not the decode object
-// is destroyed. The Offsets and CRCs are calculated independand if the an
+// is destroyed. The Offsets and CRCs are calculated whether an
// ObjectStorer was provided or not.
type Decoder struct {
s *Scanner
@@ -68,15 +68,15 @@ type Decoder struct {
}
// NewDecoder returns a new Decoder that decodes a Packfile using the given
-// s and store the objects in the provided o. ObjectStorer can be nil, in this
-// case the objects are not stored but objects offsets on the Packfile and the
-// CRCs are calculated.
+// Scanner and stores the objects in the provided EncodedObjectStorer. ObjectStorer can be nil, in this
+// If the passed EncodedObjectStorer is nil, objects are not stored, but
+// offsets on the Packfile and CRCs are calculated.
//
-// If ObjectStorer is nil and the Scanner is not Seekable, ErrNonSeekable is
+// If EncodedObjectStorer is nil and the Scanner is not Seekable, ErrNonSeekable is
// returned.
//
// If the ObjectStorer implements storer.Transactioner, a transaction is created
-// during the Decode execution, if something fails the Rollback is called
+// during the Decode execution. If anything fails, Rollback is called
func NewDecoder(s *Scanner, o storer.EncodedObjectStorer) (*Decoder, error) {
return NewDecoderForType(s, o, plumbing.AnyObject)
}
@@ -448,13 +448,13 @@ func (d *Decoder) Offsets() map[plumbing.Hash]int64 {
return d.hashToOffset
}
-// CRCs returns the CRC-32 for each objected read,Decode method should be called
+// CRCs returns the CRC-32 for each read object. Decode method should be called
// before to calculate the CRCs
func (d *Decoder) CRCs() map[plumbing.Hash]uint32 {
return d.crcs
}
-// Close close the Scanner, usually this mean that the whole reader is read and
+// Close closes the Scanner. usually this mean that the whole reader is read and
// discarded
func (d *Decoder) Close() error {
d.cache.Clear()
diff --git a/plumbing/format/packfile/diff_delta.go b/plumbing/format/packfile/diff_delta.go
index e3607bf..118c627 100644
--- a/plumbing/format/packfile/diff_delta.go
+++ b/plumbing/format/packfile/diff_delta.go
@@ -49,7 +49,7 @@ func GetDelta(base, target plumbing.EncodedObject) (plumbing.EncodedObject, erro
return delta, nil
}
-// DiffDelta returns the way of how to transform baseBuf to targetBuf
+// DiffDelta returns the delta that transforms baseBuf into targetBuf.
func DiffDelta(baseBuf []byte, targetBuf []byte) []byte {
var outBuff []byte
diff --git a/plumbing/format/packfile/encoder.go b/plumbing/format/packfile/encoder.go
index a11ba61..7419f36 100644
--- a/plumbing/format/packfile/encoder.go
+++ b/plumbing/format/packfile/encoder.go
@@ -23,7 +23,7 @@ type Encoder struct {
}
// NewEncoder creates a new packfile encoder using a specific Writer and
-// ObjectStorer
+// EncodedObjectStorer
func NewEncoder(w io.Writer, s storer.EncodedObjectStorer, useRefDeltas bool) *Encoder {
h := plumbing.Hasher{
Hash: sha1.New(),
diff --git a/plumbing/format/packfile/patch_delta.go b/plumbing/format/packfile/patch_delta.go
index 36219bb..840f840 100644
--- a/plumbing/format/packfile/patch_delta.go
+++ b/plumbing/format/packfile/patch_delta.go
@@ -13,7 +13,7 @@ import (
const deltaSizeMin = 4
-// ApplyDelta writes to taget the result of applying the modification deltas in delta to base.
+// ApplyDelta writes to target the result of applying the modification deltas in delta to base.
func ApplyDelta(target, base plumbing.EncodedObject, delta []byte) error {
r, err := base.Reader()
if err != nil {