diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2016-04-25 08:57:48 +0200 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2016-04-25 08:57:48 +0200 |
commit | 74b8b53b28d444542edc77e0beec19bbab8e8037 (patch) | |
tree | d311444af46cc4b24e48ce5f8b86da99f28585c1 /repository_test.go | |
parent | a84f6e9637d5fac2fb5a6164b633ed07c9a0a8e6 (diff) | |
download | go-git-74b8b53b28d444542edc77e0beec19bbab8e8037.tar.gz |
remote.Head and repository.PullDefault
Diffstat (limited to 'repository_test.go')
-rw-r--r-- | repository_test.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/repository_test.go b/repository_test.go index 9e81334..1f57b18 100644 --- a/repository_test.go +++ b/repository_test.go @@ -46,6 +46,20 @@ func (s *SuiteRepository) TestPull(c *C) { c.Assert(err, Not(IsNil), Commentf("pull leaks an open fd from the fetch")) } +func (s *SuiteRepository) TestPullDefault(c *C) { + r, err := NewRepository(RepositoryFixture, nil) + r.Remotes[DefaultRemoteName].Connect() + r.Remotes[DefaultRemoteName].upSrv = &MockGitUploadPackService{} + + c.Assert(err, IsNil) + c.Assert(r.PullDefault(), IsNil) + + mock, ok := (r.Remotes[DefaultRemoteName].upSrv).(*MockGitUploadPackService) + c.Assert(ok, Equals, true) + err = mock.RC.Close() + c.Assert(err, Not(IsNil), Commentf("pull leaks an open fd from the fetch")) +} + func (s *SuiteRepository) TestCommit(c *C) { r, err := NewRepository(RepositoryFixture, nil) r.Remotes["origin"].upSrv = &MockGitUploadPackService{} |