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 /remote_test.go | |
parent | a84f6e9637d5fac2fb5a6164b633ed07c9a0a8e6 (diff) | |
download | go-git-74b8b53b28d444542edc77e0beec19bbab8e8037.tar.gz |
remote.Head and repository.PullDefault
Diffstat (limited to 'remote_test.go')
-rw-r--r-- | remote_test.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/remote_test.go b/remote_test.go index 7bba597..85b464c 100644 --- a/remote_test.go +++ b/remote_test.go @@ -2,6 +2,7 @@ package git import ( "gopkg.in/src-d/go-git.v3/clients/http" + "gopkg.in/src-d/go-git.v3/core" "gopkg.in/src-d/go-git.v3/formats/packfile" "gopkg.in/src-d/go-git.v3/storage/memory" @@ -62,3 +63,17 @@ func (s *SuiteRemote) TestFetchDefaultBranch(c *C) { c.Assert(err, IsNil) c.Assert(storage.Objects, HasLen, 28) } + +func (s *SuiteRemote) TestHead(c *C) { + r, err := NewRemote(RepositoryFixture) + r.upSrv = &MockGitUploadPackService{} + + c.Assert(err, IsNil) + + err = r.Connect() + c.Assert(err, IsNil) + + hash, err := r.Head() + c.Assert(err, IsNil) + c.Assert(hash, Equals, core.NewHash("6ecf0ef2c2dffb796033e5a02219af86ec6584e5")) +} |