aboutsummaryrefslogtreecommitdiffstats
path: root/remote.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 /remote.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 'remote.go')
-rw-r--r--remote.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/remote.go b/remote.go
index 3508ed9..1d3291b 100644
--- a/remote.go
+++ b/remote.go
@@ -15,6 +15,7 @@ import (
"gopkg.in/src-d/go-git.v4/plumbing/transport"
"gopkg.in/src-d/go-git.v4/plumbing/transport/client"
"gopkg.in/src-d/go-git.v4/storage/memory"
+ "gopkg.in/src-d/go-git.v4/utils/ioutil"
)
var NoErrAlreadyUpToDate = errors.New("already up-to-date")
@@ -126,7 +127,7 @@ func (r *Remote) Fetch(o *FetchOptions) (err error) {
return err
}
- defer checkClose(reader, &err)
+ defer ioutil.CheckClose(reader, &err)
if err = r.updateObjectStorage(
r.buildSidebandIfSupported(req.Capabilities, reader),
@@ -163,7 +164,7 @@ func (r *Remote) getWantedReferences(spec []config.RefSpec) ([]*plumbing.Referen
}
}
- _, err := r.s.Object(plumbing.CommitObject, ref.Hash())
+ _, err := r.s.EncodedObject(plumbing.CommitObject, ref.Hash())
if err == plumbing.ErrObjectNotFound {
refs = append(refs, ref)
return nil
@@ -281,7 +282,7 @@ func (r *Remote) buildFetchedTags() error {
return nil
}
- _, err := r.s.Object(plumbing.AnyObject, ref.Hash())
+ _, err := r.s.EncodedObject(plumbing.AnyObject, ref.Hash())
if err == plumbing.ErrObjectNotFound {
return nil
}