From a48bc6e17ef6298f93ec21cdf1a5e387640673b6 Mon Sep 17 00:00:00 2001 From: Máximo Cuadros Date: Mon, 30 Jan 2017 14:42:19 +0100 Subject: Repository.Progress moved as a field in *Options (#237) --- repository_test.go | 45 ++++++++++++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 15 deletions(-) (limited to 'repository_test.go') 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() -- cgit