diff options
author | Santiago M. Mola <santi@mola.io> | 2016-12-14 23:12:44 +0100 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2016-12-14 23:12:44 +0100 |
commit | 0af572dd21c0aa79d13745b633ee24ba6c4d6cf1 (patch) | |
tree | 49e81e74e82d84fd88b2fc1e4b0dc7c7bfe9c40f /plumbing/format/packfile/object_pack.go | |
parent | df0f38af83f972f026d7e14150f3d37b95f13484 (diff) | |
download | go-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/object_pack.go')
-rw-r--r-- | plumbing/format/packfile/object_pack.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/plumbing/format/packfile/object_pack.go b/plumbing/format/packfile/object_pack.go index dc5a3c7..dfe9bb2 100644 --- a/plumbing/format/packfile/object_pack.go +++ b/plumbing/format/packfile/object_pack.go @@ -6,20 +6,21 @@ import "gopkg.in/src-d/go-git.v4/plumbing" // pack file. type ObjectToPack struct { // The main object to pack, it could be any object, including deltas - Object plumbing.Object + Object plumbing.EncodedObject // Base is the object that a delta is based on (it could be also another delta). // If the main object is not a delta, Base will be null Base *ObjectToPack // Original is the object that we can generate applying the delta to - // Base, or the same object as Object in the case of a non-delta object. - Original plumbing.Object + // Base, or the same object as EncodedObject in the case of a non-delta + // object. + Original plumbing.EncodedObject // Depth is the amount of deltas needed to resolve to obtain Original // (delta based on delta based on ...) Depth int } // newObjectToPack creates a correct ObjectToPack based on a non-delta object -func newObjectToPack(o plumbing.Object) *ObjectToPack { +func newObjectToPack(o plumbing.EncodedObject) *ObjectToPack { return &ObjectToPack{ Object: o, Original: o, @@ -29,7 +30,7 @@ func newObjectToPack(o plumbing.Object) *ObjectToPack { // newDeltaObjectToPack creates a correct ObjectToPack for a delta object, based on // his base (could be another delta), the delta target (in this case called original), // and the delta Object itself -func newDeltaObjectToPack(base *ObjectToPack, original, delta plumbing.Object) *ObjectToPack { +func newDeltaObjectToPack(base *ObjectToPack, original, delta plumbing.EncodedObject) *ObjectToPack { return &ObjectToPack{ Object: delta, Base: base, |