aboutsummaryrefslogtreecommitdiffstats
path: root/repository_test.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-04-25 08:57:48 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2016-04-25 08:57:48 +0200
commit74b8b53b28d444542edc77e0beec19bbab8e8037 (patch)
treed311444af46cc4b24e48ce5f8b86da99f28585c1 /repository_test.go
parenta84f6e9637d5fac2fb5a6164b633ed07c9a0a8e6 (diff)
downloadgo-git-74b8b53b28d444542edc77e0beec19bbab8e8037.tar.gz
remote.Head and repository.PullDefault
Diffstat (limited to 'repository_test.go')
-rw-r--r--repository_test.go14
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{}