diff options
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")) +} |