diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2017-01-30 11:40:51 +0100 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2017-01-30 11:40:51 +0100 |
commit | 45669655f026a31577f938ee70ae613c2e4af184 (patch) | |
tree | 7ac0cdf53b1d0175c1a7b9374678017560a18400 | |
parent | 677a596cdb534f485ff8d9488e05855387a6ef00 (diff) | |
download | go-git-45669655f026a31577f938ee70ae613c2e4af184.tar.gz |
test and comments improvements
-rw-r--r-- | common_test.go | 3 | ||||
-rw-r--r-- | repository.go | 6 | ||||
-rw-r--r-- | repository_test.go | 6 |
3 files changed, 10 insertions, 5 deletions
diff --git a/common_test.go b/common_test.go index 783a99b..9c20a9a 100644 --- a/common_test.go +++ b/common_test.go @@ -4,8 +4,6 @@ import ( "fmt" "testing" - "srcd.works/go-billy.v1/os" - "gopkg.in/src-d/go-git.v4/fixtures" "gopkg.in/src-d/go-git.v4/plumbing" "gopkg.in/src-d/go-git.v4/plumbing/format/packfile" @@ -17,6 +15,7 @@ import ( . "gopkg.in/check.v1" memoryfs "srcd.works/go-billy.v1/memory" + "srcd.works/go-billy.v1/os" ) func Test(t *testing.T) { TestingT(t) } diff --git a/repository.go b/repository.go index 82ebb0c..1d69fe8 100644 --- a/repository.go +++ b/repository.go @@ -39,7 +39,7 @@ type Repository struct { Progress sideband.Progress } -// Init create an empty git repository, based on the given Storer and worktree. +// Init creates an empty git repository, based on the given Storer and worktree. // The worktree Filesystem is optional, if nil a bare repository is created. If // the given storer is not empty ErrRepositoryAlreadyExists is returned func Init(s Storer, worktree billy.Filesystem) (*Repository, error) { @@ -67,8 +67,8 @@ func Init(s Storer, worktree billy.Filesystem) (*Repository, error) { // Open opens a git repository using the given Storer and worktree filesystem, // if the given storer is complete empty ErrRepositoryNotExists is returned. -// The worktree can be nil when the repository being open is bare, if the -// a non-bare repository is not provied and worktree is nil, the err +// The worktree can be nil when the repository being opened is bare, if the +// repository is a normal one (not bare) and worktree is nil the err // ErrWorktreeNotProvided is returned func Open(s Storer, worktree billy.Filesystem) (*Repository, error) { _, err := s.Reference(plumbing.HEAD) diff --git a/repository_test.go b/repository_test.go index ead0aa1..7d44a30 100644 --- a/repository_test.go +++ b/repository_test.go @@ -171,6 +171,7 @@ func (s *RepositorySuite) TestDeleteRemote(c *C) { func (s *RepositorySuite) TestPlainInit(c *C) { dir, err := ioutil.TempDir("", "plain-init") + c.Assert(err, IsNil) defer os.RemoveAll(dir) r, err := PlainInit(dir, true) @@ -184,6 +185,7 @@ func (s *RepositorySuite) TestPlainInit(c *C) { func (s *RepositorySuite) TestPlainInitAlreadyExists(c *C) { dir, err := ioutil.TempDir("", "plain-init") + c.Assert(err, IsNil) defer os.RemoveAll(dir) r, err := PlainInit(dir, true) @@ -197,6 +199,7 @@ func (s *RepositorySuite) TestPlainInitAlreadyExists(c *C) { func (s *RepositorySuite) TestPlainOpen(c *C) { dir, err := ioutil.TempDir("", "plain-open") + c.Assert(err, IsNil) defer os.RemoveAll(dir) r, err := PlainInit(dir, false) @@ -210,6 +213,7 @@ func (s *RepositorySuite) TestPlainOpen(c *C) { func (s *RepositorySuite) TestPlainOpenBare(c *C) { dir, err := ioutil.TempDir("", "plain-open") + c.Assert(err, IsNil) defer os.RemoveAll(dir) r, err := PlainInit(dir, true) @@ -223,6 +227,7 @@ func (s *RepositorySuite) TestPlainOpenBare(c *C) { func (s *RepositorySuite) TestPlainOpenNotBare(c *C) { dir, err := ioutil.TempDir("", "plain-open") + c.Assert(err, IsNil) defer os.RemoveAll(dir) r, err := PlainInit(dir, false) @@ -242,6 +247,7 @@ func (s *RepositorySuite) TestPlainOpenNotExists(c *C) { func (s *RepositorySuite) TestPlainClone(c *C) { dir, err := ioutil.TempDir("", "plain-clone") + c.Assert(err, IsNil) defer os.RemoveAll(dir) r, err := PlainClone(dir, false, &CloneOptions{ |