diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2016-08-22 00:30:50 +0200 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2016-08-22 00:30:50 +0200 |
commit | 5b13c1a2e55cb442484d9c7b45389f422b110eec (patch) | |
tree | 9be0949cb354dfd6521aa84f4af9e5777c3a1cef /repository_test.go | |
parent | f42d82364c5d159f65a48e720433ad2bc97f0b7f (diff) | |
download | go-git-5b13c1a2e55cb442484d9c7b45389f422b110eec.tar.gz |
options renamed and some text fixes
Diffstat (limited to 'repository_test.go')
-rw-r--r-- | repository_test.go | 54 |
1 files changed, 19 insertions, 35 deletions
diff --git a/repository_test.go b/repository_test.go index 462fbcf..6ad0d1e 100644 --- a/repository_test.go +++ b/repository_test.go @@ -61,20 +61,18 @@ func (s *RepositorySuite) TearDownSuite(c *C) { } func (s *RepositorySuite) TestNewRepository(c *C) { - r, err := NewMemoryRepository() - c.Assert(err, IsNil) + r := NewMemoryRepository() c.Assert(r, NotNil) } func (s *RepositorySuite) TestClone(c *C) { - r, err := NewMemoryRepository() - c.Assert(err, IsNil) + r := NewMemoryRepository() head, err := r.Head() c.Assert(err, Equals, core.ErrReferenceNotFound) c.Assert(head, IsNil) - err = r.Clone(&RepositoryCloneOptions{ + err = r.Clone(&CloneOptions{ URL: RepositoryFixture, }) @@ -109,14 +107,13 @@ func (s *RepositorySuite) TestClone(c *C) { } func (s *RepositorySuite) TestCloneSingleBranchAndNonHEAD(c *C) { - r, err := NewMemoryRepository() - c.Assert(err, IsNil) + r := NewMemoryRepository() head, err := r.Head() c.Assert(err, Equals, core.ErrReferenceNotFound) c.Assert(head, IsNil) - err = r.Clone(&RepositoryCloneOptions{ + err = r.Clone(&CloneOptions{ URL: RepositoryFixture, ReferenceName: core.ReferenceName("refs/heads/branch"), SingleBranch: true, @@ -147,14 +144,13 @@ func (s *RepositorySuite) TestCloneSingleBranchAndNonHEAD(c *C) { } func (s *RepositorySuite) TestCloneSingleBranch(c *C) { - r, err := NewMemoryRepository() - c.Assert(err, IsNil) + r := NewMemoryRepository() head, err := r.Head() c.Assert(err, Equals, core.ErrReferenceNotFound) c.Assert(head, IsNil) - err = r.Clone(&RepositoryCloneOptions{ + err = r.Clone(&CloneOptions{ URL: RepositoryFixture, SingleBranch: true, }) @@ -184,10 +180,8 @@ func (s *RepositorySuite) TestCloneSingleBranch(c *C) { } func (s *RepositorySuite) TestCloneDetachedHEAD(c *C) { - r, err := NewMemoryRepository() - c.Assert(err, IsNil) - - err = r.Clone(&RepositoryCloneOptions{ + r := NewMemoryRepository() + err := r.Clone(&CloneOptions{ URL: RepositoryFixture, ReferenceName: core.ReferenceName("refs/tags/v1.0.0"), }) @@ -200,10 +194,8 @@ func (s *RepositorySuite) TestCloneDetachedHEAD(c *C) { } func (s *RepositorySuite) TestCommit(c *C) { - r, err := NewMemoryRepository() - c.Assert(err, IsNil) - - err = r.Clone(&RepositoryCloneOptions{ + r := NewMemoryRepository() + err := r.Clone(&CloneOptions{ URL: RepositoryFixture, }) @@ -222,10 +214,8 @@ func (s *RepositorySuite) TestCommit(c *C) { } func (s *RepositorySuite) TestCommits(c *C) { - r, err := NewMemoryRepository() - c.Assert(err, IsNil) - - err = r.Clone(&RepositoryCloneOptions{URL: RepositoryFixture}) + r := NewMemoryRepository() + err := r.Clone(&CloneOptions{URL: RepositoryFixture}) c.Assert(err, IsNil) count := 0 @@ -288,10 +278,8 @@ func (s *RepositorySuite) TestObject(c *C) { } func (s *RepositorySuite) TestCommitIterClosePanic(c *C) { - r, err := NewMemoryRepository() - c.Assert(err, IsNil) - - err = r.Clone(&RepositoryCloneOptions{URL: RepositoryFixture}) + r := NewMemoryRepository() + err := r.Clone(&CloneOptions{URL: RepositoryFixture}) c.Assert(err, IsNil) commits, err := r.Commits() @@ -300,10 +288,8 @@ func (s *RepositorySuite) TestCommitIterClosePanic(c *C) { } func (s *RepositorySuite) TestRef(c *C) { - r, err := NewMemoryRepository() - c.Assert(err, IsNil) - - err = r.Clone(&RepositoryCloneOptions{URL: RepositoryFixture}) + r := NewMemoryRepository() + err := r.Clone(&CloneOptions{URL: RepositoryFixture}) c.Assert(err, IsNil) ref, err := r.Ref(core.HEAD, false) @@ -316,10 +302,8 @@ func (s *RepositorySuite) TestRef(c *C) { } func (s *RepositorySuite) TestRefs(c *C) { - r, err := NewMemoryRepository() - c.Assert(err, IsNil) - - err = r.Clone(&RepositoryCloneOptions{URL: RepositoryFixture}) + r := NewMemoryRepository() + err := r.Clone(&CloneOptions{URL: RepositoryFixture}) c.Assert(err, IsNil) c.Assert(err, IsNil) |