aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/format/packfile/encoder.go
diff options
context:
space:
mode:
authorSantiago M. Mola <santi@mola.io>2016-12-14 23:12:44 +0100
committerMáximo Cuadros <mcuadros@gmail.com>2016-12-14 23:12:44 +0100
commit0af572dd21c0aa79d13745b633ee24ba6c4d6cf1 (patch)
tree49e81e74e82d84fd88b2fc1e4b0dc7c7bfe9c40f /plumbing/format/packfile/encoder.go
parentdf0f38af83f972f026d7e14150f3d37b95f13484 (diff)
downloadgo-git-0af572dd21c0aa79d13745b633ee24ba6c4d6cf1.tar.gz
move plumbing from top level package to plumbing (#183)
* plumbing: rename Object -> EncodedObject. * plumbing/storer: rename ObjectStorer -> EncodedObjectStorer. * move difftree to plumbing/difftree. * move diff -> utils/diff * make Object/Tag/Blob/Tree/Commit/File depend on storer. * Object and its implementations now depend only on storer.EncodedObjectStorer, not git.Repository. * Tests are decoupled accordingly. * move Object/Commit/File/Tag/Tree to plumbing/object. * move Object/Commit/File/Tag/Tree to plumbing/object. * move checkClose to utils/ioutil. * move RevListObjects to plumbing/revlist.Objects. * move DiffTree to plumbing/difftree package. * rename files with plural nouns to singular * plumbing/object: add GetBlob/GetCommit/GetTag/GetTree.
Diffstat (limited to 'plumbing/format/packfile/encoder.go')
-rw-r--r--plumbing/format/packfile/encoder.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/plumbing/format/packfile/encoder.go b/plumbing/format/packfile/encoder.go
index eb1c532..847e9e1 100644
--- a/plumbing/format/packfile/encoder.go
+++ b/plumbing/format/packfile/encoder.go
@@ -14,7 +14,7 @@ import (
// Encoder gets the data from the storage and write it into the writer in PACK
// format
type Encoder struct {
- storage storer.ObjectStorer
+ storage storer.EncodedObjectStorer
w *offsetWriter
zw *zlib.Writer
hasher plumbing.Hasher
@@ -23,7 +23,7 @@ type Encoder struct {
// NewEncoder creates a new packfile encoder using a specific Writer and
// ObjectStorer
-func NewEncoder(w io.Writer, s storer.ObjectStorer) *Encoder {
+func NewEncoder(w io.Writer, s storer.EncodedObjectStorer) *Encoder {
h := plumbing.Hasher{
Hash: sha1.New(),
}
@@ -44,7 +44,7 @@ func NewEncoder(w io.Writer, s storer.ObjectStorer) *Encoder {
func (e *Encoder) Encode(hashes []plumbing.Hash) (plumbing.Hash, error) {
var objects []*ObjectToPack
for _, h := range hashes {
- o, err := e.storage.Object(plumbing.AnyObject, h)
+ o, err := e.storage.EncodedObject(plumbing.AnyObject, h)
if err != nil {
return plumbing.ZeroHash, err
}