aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--blame.go5
-rw-r--r--plumbing/serverinfo/serverinfo_test.go1
-rw-r--r--remote_test.go2
-rw-r--r--worktree_commit_test.go4
-rw-r--r--worktree_test.go6
5 files changed, 11 insertions, 7 deletions
diff --git a/blame.go b/blame.go
index 2a877dc..e83caf3 100644
--- a/blame.go
+++ b/blame.go
@@ -97,13 +97,10 @@ func Blame(c *object.Commit, path string) (*BlameResult, error) {
if err != nil {
return nil, err
}
- if finished == true {
+ if finished {
break
}
}
- if err != nil {
- return nil, err
- }
b.lineToCommit = make([]*object.Commit, finalLength)
for i := range needsMap {
diff --git a/plumbing/serverinfo/serverinfo_test.go b/plumbing/serverinfo/serverinfo_test.go
index 0a52ea2..251746b 100644
--- a/plumbing/serverinfo/serverinfo_test.go
+++ b/plumbing/serverinfo/serverinfo_test.go
@@ -179,6 +179,7 @@ func (s *ServerInfoSuite) TestUpdateServerInfoBasicChange(c *C) {
c.Assert(err, IsNil)
err = UpdateServerInfo(st, fs)
+ c.Assert(err, IsNil)
assertInfoRefs(c, st, fs)
assertObjectPacks(c, st, fs)
diff --git a/remote_test.go b/remote_test.go
index 1ffedd4..d1439d5 100644
--- a/remote_test.go
+++ b/remote_test.go
@@ -1489,6 +1489,7 @@ func (s *RemoteSuite) TestFetchPrune(c *C) {
err = remote.Push(&PushOptions{RefSpecs: []config.RefSpec{
":refs/heads/branch",
}})
+ c.Assert(err, IsNil)
AssertReferences(c, rSave, map[string]string{
"refs/remotes/origin/branch": ref.Hash().String(),
@@ -1546,6 +1547,7 @@ func (s *RemoteSuite) TestFetchPruneTags(c *C) {
err = remote.Push(&PushOptions{RefSpecs: []config.RefSpec{
":refs/tags/v1",
}})
+ c.Assert(err, IsNil)
AssertReferences(c, rSave, map[string]string{
"refs/tags/v1": ref.Hash().String(),
diff --git a/worktree_commit_test.go b/worktree_commit_test.go
index fee8b15..ae8f841 100644
--- a/worktree_commit_test.go
+++ b/worktree_commit_test.go
@@ -233,7 +233,9 @@ func (s *WorktreeSuite) TestAddAndCommitWithSkipStatusPathNotModified(c *C) {
})
c.Assert(hash, Equals, expected)
c.Assert(err, IsNil)
+
commit1, err := w.r.CommitObject(hash)
+ c.Assert(err, IsNil)
status, err = w.Status()
c.Assert(err, IsNil)
@@ -260,7 +262,9 @@ func (s *WorktreeSuite) TestAddAndCommitWithSkipStatusPathNotModified(c *C) {
})
c.Assert(hash, Equals, expected2)
c.Assert(err, IsNil)
+
commit2, err := w.r.CommitObject(hash)
+ c.Assert(err, IsNil)
status, err = w.Status()
c.Assert(err, IsNil)
diff --git a/worktree_test.go b/worktree_test.go
index 668c30a..f67cca2 100644
--- a/worktree_test.go
+++ b/worktree_test.go
@@ -4,7 +4,6 @@ import (
"bytes"
"context"
"errors"
- "fmt"
"io"
"os"
"path/filepath"
@@ -1241,6 +1240,7 @@ func (s *WorktreeSuite) TestResetHardWithGitIgnore(c *C) {
f, err := fs.Create(".gitignore")
c.Assert(err, IsNil)
_, err = f.Write([]byte("foo\n"))
+ c.Assert(err, IsNil)
_, err = f.Write([]byte("newTestFile.txt\n"))
c.Assert(err, IsNil)
err = f.Close()
@@ -2982,7 +2982,7 @@ func TestValidPath(t *testing.T) {
}
for _, tc := range tests {
- t.Run(fmt.Sprintf("%s", tc.path), func(t *testing.T) {
+ t.Run(tc.path, func(t *testing.T) {
err := validPath(tc.path)
if tc.wantErr {
assert.Error(t, err)
@@ -3013,7 +3013,7 @@ func TestWindowsValidPath(t *testing.T) {
}
for _, tc := range tests {
- t.Run(fmt.Sprintf("%s", tc.path), func(t *testing.T) {
+ t.Run(tc.path, func(t *testing.T) {
got := windowsValidPath(tc.path)
assert.Equal(t, tc.want, got)
})