aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/object
diff options
context:
space:
mode:
authorOleg Kovalov <iamolegkovalov@gmail.com>2020-07-01 20:51:24 +0200
committerOleg Kovalov <iamolegkovalov@gmail.com>2020-07-01 20:51:24 +0200
commit27a034c7643768a4ad486a64e8a1b59fa3f8b3b4 (patch)
tree9d6e25bf60cbd0e1aabbba687f2655867f113c1e /plumbing/object
parent9ac753f4afb36feb1a1c22214c16e853db54aa00 (diff)
downloadgo-git-27a034c7643768a4ad486a64e8a1b59fa3f8b3b4.tar.gz
fix goreportcard warnings
Diffstat (limited to 'plumbing/object')
-rw-r--r--plumbing/object/commit_stats_test.go3
-rw-r--r--plumbing/object/commit_walker_bfs_filtered.go1
-rw-r--r--plumbing/object/commit_walker_path.go3
-rw-r--r--plumbing/object/commitgraph/commitnode_test.go5
-rw-r--r--plumbing/object/commitgraph/commitnode_walker_ctime.go4
-rw-r--r--plumbing/object/patch_test.go5
-rw-r--r--plumbing/object/rename.go6
7 files changed, 14 insertions, 13 deletions
diff --git a/plumbing/object/commit_stats_test.go b/plumbing/object/commit_stats_test.go
index bce2953..4078ce8 100644
--- a/plumbing/object/commit_stats_test.go
+++ b/plumbing/object/commit_stats_test.go
@@ -11,8 +11,9 @@ import (
"github.com/go-git/go-billy/v5/memfs"
"github.com/go-git/go-billy/v5/util"
+
+ fixtures "github.com/go-git/go-git-fixtures/v4"
. "gopkg.in/check.v1"
- "github.com/go-git/go-git-fixtures/v4"
)
type CommitStatsSuite struct {
diff --git a/plumbing/object/commit_walker_bfs_filtered.go b/plumbing/object/commit_walker_bfs_filtered.go
index e87c3db..9d51813 100644
--- a/plumbing/object/commit_walker_bfs_filtered.go
+++ b/plumbing/object/commit_walker_bfs_filtered.go
@@ -173,4 +173,3 @@ func (w *filterCommitIter) addToQueue(
return nil
}
-
diff --git a/plumbing/object/commit_walker_path.go b/plumbing/object/commit_walker_path.go
index af6f745..aa0ca15 100644
--- a/plumbing/object/commit_walker_path.go
+++ b/plumbing/object/commit_walker_path.go
@@ -4,7 +4,6 @@ import (
"io"
"github.com/go-git/go-git/v5/plumbing"
-
"github.com/go-git/go-git/v5/plumbing/storer"
)
@@ -29,7 +28,7 @@ func NewCommitPathIterFromIter(pathFilter func(string) bool, commitIter CommitIt
return iterator
}
-// this function is kept for compatibilty, can be replaced with NewCommitPathIterFromIter
+// NewCommitFileIterFromIter is kept for compatibility, can be replaced with NewCommitPathIterFromIter
func NewCommitFileIterFromIter(fileName string, commitIter CommitIter, checkParent bool) CommitIter {
return NewCommitPathIterFromIter(
func(path string) bool {
diff --git a/plumbing/object/commitgraph/commitnode_test.go b/plumbing/object/commitgraph/commitnode_test.go
index 38d3bce..6c9a643 100644
--- a/plumbing/object/commitgraph/commitnode_test.go
+++ b/plumbing/object/commitgraph/commitnode_test.go
@@ -4,13 +4,14 @@ import (
"path"
"testing"
- . "gopkg.in/check.v1"
- fixtures "github.com/go-git/go-git-fixtures/v4"
"github.com/go-git/go-git/v5/plumbing"
"github.com/go-git/go-git/v5/plumbing/cache"
"github.com/go-git/go-git/v5/plumbing/format/commitgraph"
"github.com/go-git/go-git/v5/plumbing/format/packfile"
"github.com/go-git/go-git/v5/storage/filesystem"
+
+ fixtures "github.com/go-git/go-git-fixtures/v4"
+ . "gopkg.in/check.v1"
)
func Test(t *testing.T) { TestingT(t) }
diff --git a/plumbing/object/commitgraph/commitnode_walker_ctime.go b/plumbing/object/commitgraph/commitnode_walker_ctime.go
index f2ed663..281f10b 100644
--- a/plumbing/object/commitgraph/commitnode_walker_ctime.go
+++ b/plumbing/object/commitgraph/commitnode_walker_ctime.go
@@ -3,10 +3,10 @@ package commitgraph
import (
"io"
- "github.com/emirpasic/gods/trees/binaryheap"
-
"github.com/go-git/go-git/v5/plumbing"
"github.com/go-git/go-git/v5/plumbing/storer"
+
+ "github.com/emirpasic/gods/trees/binaryheap"
)
type commitNodeIteratorByCTime struct {
diff --git a/plumbing/object/patch_test.go b/plumbing/object/patch_test.go
index d4b6cd6..2cff795 100644
--- a/plumbing/object/patch_test.go
+++ b/plumbing/object/patch_test.go
@@ -1,11 +1,12 @@
package object
import (
- . "gopkg.in/check.v1"
- fixtures "github.com/go-git/go-git-fixtures/v4"
"github.com/go-git/go-git/v5/plumbing"
"github.com/go-git/go-git/v5/plumbing/cache"
"github.com/go-git/go-git/v5/storage/filesystem"
+
+ fixtures "github.com/go-git/go-git-fixtures/v4"
+ . "gopkg.in/check.v1"
)
type PatchSuite struct {
diff --git a/plumbing/object/rename.go b/plumbing/object/rename.go
index 35af1d6..7fed72c 100644
--- a/plumbing/object/rename.go
+++ b/plumbing/object/rename.go
@@ -536,7 +536,7 @@ var errIndexFull = errors.New("index is full")
// between two files.
// To save space in memory, this index uses a space efficient encoding which
// will not exceed 1MiB per instance. The index starts out at a smaller size
-// (closer to 2KiB), but may grow as more distinct blocks withing the scanned
+// (closer to 2KiB), but may grow as more distinct blocks within the scanned
// file are discovered.
// see: https://github.com/eclipse/jgit/blob/master/org.eclipse.jgit/src/org/eclipse/jgit/diff/SimilarityIndex.java
type similarityIndex struct {
@@ -709,7 +709,7 @@ func (i *similarityIndex) common(dst *similarityIndex) uint64 {
}
func (i *similarityIndex) add(key int, cnt uint64) error {
- key = int(uint32(key)*0x9e370001 >> 1)
+ key = int(uint32(key) * 0x9e370001 >> 1)
j := i.slot(key)
for {
@@ -769,7 +769,7 @@ func (i *similarityIndex) slot(key int) int {
// We use 31 - hashBits because the upper bit was already forced
// to be 0 and we want the remaining high bits to be used as the
// table slot.
- return int(uint32(key) >> uint(31 - i.hashBits))
+ return int(uint32(key) >> uint(31-i.hashBits))
}
func shouldGrowAt(hashBits int) int {