Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Added missing error checks in tests #1184

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions plumbing/format/packfile/scanner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ func (s *ScannerSuite) TestReaderReset(c *C) {
p := NewScanner(r)

version, objects, err := p.Header()
c.Assert(err, IsNil)
c.Assert(version, Equals, VersionSupported)
c.Assert(objects, Equals, uint32(31))

Expand Down
1 change: 1 addition & 0 deletions plumbing/object/patch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ func (s *PatchSuite) TestStatsWithSubmodules(c *C) {
fixtures.ByURL("https://github.com/git-fixtures/submodule.git").One().DotGit(), cache.NewObjectLRUDefault())

commit, err := GetCommit(storer, plumbing.NewHash("b685400c1f9316f350965a5993d350bc746b0bf4"))
c.Assert(err, IsNil)

tree, err := commit.Tree()
c.Assert(err, IsNil)
Expand Down
2 changes: 2 additions & 0 deletions prune_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ func (s *PruneSuite) testPrune(c *C, deleteTime time.Time) {
newCount++
return nil
})
c.Assert(err, IsNil)

if deleteTime.IsZero() {
c.Assert(newCount < count, Equals, true)
} else {
Expand Down
4 changes: 3 additions & 1 deletion repository_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,12 +335,14 @@ func (s *RepositorySuite) TestCreateBranchUnmarshal(c *C) {
Merge: "refs/heads/foo",
}
err = r.CreateBranch(testBranch1)
c.Assert(err, IsNil)
err = r.CreateBranch(testBranch2)

c.Assert(err, IsNil)

cfg, err := r.Config()
c.Assert(err, IsNil)
marshaled, err := cfg.Marshal()
c.Assert(err, IsNil)
c.Assert(string(expected), Equals, string(marshaled))
}

Expand Down
1 change: 1 addition & 0 deletions storage/filesystem/dotgit/dotgit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ func (s *SuiteDotGit) TestRemoveRefFromReferenceFileAndPackedRefs(c *C) {
"refs/remotes/origin/branch",
"e8d3ffab552895c19b9fcf7aa264d277cde33881",
), nil)
c.Assert(err, IsNil)

// Make sure it only appears once in the refs list.
refs, err := dir.Refs()
Expand Down
2 changes: 1 addition & 1 deletion worktree_commit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ func (s *WorktreeSuite) TestCommitTreeSort(c *C) {
r, err := Init(st, nil)
c.Assert(err, IsNil)

r, err = Clone(memory.NewStorage(), memfs.New(), &CloneOptions{
r, _ = Clone(memory.NewStorage(), memfs.New(), &CloneOptions{
URL: path,
})

Expand Down
1 change: 1 addition & 0 deletions worktree_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1675,6 +1675,7 @@ func (s *WorktreeSuite) TestClean(c *C) {

// Status before cleaning.
status, err := wt.Status()
c.Assert(err, IsNil)
c.Assert(len(status), Equals, 2)

err = wt.Clean(&CleanOptions{})
Expand Down