aboutsummaryrefslogtreecommitdiffstats
path: root/repository_test.go
diff options
context:
space:
mode:
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 7d44a30..1c43c6e 100644
--- a/repository_test.go
+++ b/repository_test.go
@@ -129,21 +129,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, _ := Init(memory.NewStorage(), nil)
- 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, _ := Init(memory.NewStorage(), nil)
remote, err := r.CreateRemote(&config.RemoteConfig{})
@@ -449,6 +434,19 @@ func (s *RepositorySuite) TestPullCheckout(c *C) {
c.Assert(fi, HasLen, 8)
}
+func (s *RepositorySuite) TestCloneWithProgress(c *C) {
+ fs := memoryfs.New()
+
+ buf := bytes.NewBuffer(nil)
+ _, err := Clone(memory.NewStorage(), fs, &CloneOptions{
+ URL: s.GetBasicLocalRepositoryURL(),
+ Progress: buf,
+ })
+
+ c.Assert(err, IsNil)
+ c.Assert(buf.Len(), Not(Equals), 0)
+}
+
func (s *RepositorySuite) TestPullUpdateReferencesIfNeeded(c *C) {
r, _ := Init(memory.NewStorage(), nil)
r.CreateRemote(&config.RemoteConfig{
@@ -500,6 +498,23 @@ func (s *RepositorySuite) TestPullSingleBranch(c *C) {
c.Assert(storage.Objects, HasLen, 28)
}
+func (s *RepositorySuite) TestPullProgress(c *C) {
+ r, _ := Init(memory.NewStorage(), nil)
+
+ 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()