aboutsummaryrefslogtreecommitdiffstats
path: root/repository_test.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-01-30 14:42:19 +0100
committerGitHub <noreply@github.com>2017-01-30 14:42:19 +0100
commita48bc6e17ef6298f93ec21cdf1a5e387640673b6 (patch)
treed2fa569b6c2c7699fa6f7c2a60b9bce90f1e55f8 /repository_test.go
parent77b6391a050743f3f0aa46018db65853c7167df5 (diff)
downloadgo-git-a48bc6e17ef6298f93ec21cdf1a5e387640673b6.tar.gz
Repository.Progress moved as a field in *Options (#237)
Diffstat (limited to 'repository_test.go')
-rw-r--r--repository_test.go45
1 files changed, 30 insertions, 15 deletions
diff --git a/repository_test.go b/repository_test.go
index 5cbc8dd..336582e 100644
--- a/repository_test.go
+++ b/repository_test.go
@@ -45,21 +45,6 @@ func (s *RepositorySuite) TestCreateRemoteAndRemote(c *C) {
c.Assert(alt.Config().Name, Equals, "foo")
}
-func (s *RepositorySuite) TestRemoteWithProgress(c *C) {
- buf := bytes.NewBuffer(nil)
-
- r := NewMemoryRepository()
- r.Progress = buf
-
- remote, err := r.CreateRemote(&config.RemoteConfig{
- Name: "foo",
- URL: "http://foo/foo.git",
- })
-
- c.Assert(err, IsNil)
- c.Assert(remote.p, Equals, buf)
-}
-
func (s *RepositorySuite) TestCreateRemoteInvalid(c *C) {
r := NewMemoryRepository()
remote, err := r.CreateRemote(&config.RemoteConfig{})
@@ -266,6 +251,19 @@ func (s *RepositorySuite) TestCloneDetachedHEAD(c *C) {
c.Assert(head.Hash().String(), Equals, "6ecf0ef2c2dffb796033e5a02219af86ec6584e5")
}
+func (s *RepositorySuite) TestCloneWithProgress(c *C) {
+ r := NewMemoryRepository()
+
+ buf := bytes.NewBuffer(nil)
+ err := r.Clone(&CloneOptions{
+ URL: s.GetBasicLocalRepositoryURL(),
+ Progress: buf,
+ })
+
+ c.Assert(err, IsNil)
+ c.Assert(buf.Len(), Not(Equals), 0)
+}
+
func (s *RepositorySuite) TestPullUpdateReferencesIfNeeded(c *C) {
r := NewMemoryRepository()
r.CreateRemote(&config.RemoteConfig{
@@ -317,6 +315,23 @@ func (s *RepositorySuite) TestPullSingleBranch(c *C) {
c.Assert(storage.Objects, HasLen, 28)
}
+func (s *RepositorySuite) TestPullProgress(c *C) {
+ r := NewMemoryRepository()
+
+ r.CreateRemote(&config.RemoteConfig{
+ Name: DefaultRemoteName,
+ URL: s.GetBasicLocalRepositoryURL(),
+ })
+
+ buf := bytes.NewBuffer(nil)
+ err := r.Pull(&PullOptions{
+ Progress: buf,
+ })
+
+ c.Assert(err, IsNil)
+ c.Assert(buf.Len(), Not(Equals), 0)
+}
+
func (s *RepositorySuite) TestPullAdd(c *C) {
path := fixtures.Basic().One().Worktree().Base()