aboutsummaryrefslogtreecommitdiffstats
path: root/repository.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2020-07-16 21:29:58 +0200
committerGitHub <noreply@github.com>2020-07-16 21:29:58 +0200
commit641ee1dd69d3b8616127623e4b9341f4f4196d12 (patch)
treec37ce033ec64f0378acc2cde8ae59a54cdd74667 /repository.go
parent7906922c319b6077e8e66b70711073fb59a08a20 (diff)
parent8b8e4561eec882fad6e93d8e4257a9dc21311f3e (diff)
downloadgo-git-641ee1dd69d3b8616127623e4b9341f4f4196d12.tar.gz
Merge pull request #125 from cristaloleg/minor-linter-fixes
*: minor linter fixes
Diffstat (limited to 'repository.go')
-rw-r--r--repository.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/repository.go b/repository.go
index 66c0918..9dd35be 100644
--- a/repository.go
+++ b/repository.go
@@ -1440,9 +1440,9 @@ func (r *Repository) ResolveRevision(rev plumbing.Revision) (*plumbing.Hash, err
var commit *object.Commit
for _, item := range items {
- switch item.(type) {
+ switch item := item.(type) {
case revision.Ref:
- revisionRef := item.(revision.Ref)
+ revisionRef := item
var tryHashes []plumbing.Hash
@@ -1491,7 +1491,7 @@ func (r *Repository) ResolveRevision(rev plumbing.Revision) (*plumbing.Hash, err
}
case revision.CaretPath:
- depth := item.(revision.CaretPath).Depth
+ depth := item.Depth
if depth == 0 {
break
@@ -1519,7 +1519,7 @@ func (r *Repository) ResolveRevision(rev plumbing.Revision) (*plumbing.Hash, err
commit = c
case revision.TildePath:
- for i := 0; i < item.(revision.TildePath).Depth; i++ {
+ for i := 0; i < item.Depth; i++ {
c, err := commit.Parents().Next()
if err != nil {
@@ -1531,8 +1531,8 @@ func (r *Repository) ResolveRevision(rev plumbing.Revision) (*plumbing.Hash, err
case revision.CaretReg:
history := object.NewCommitPreorderIter(commit, nil, nil)
- re := item.(revision.CaretReg).Regexp
- negate := item.(revision.CaretReg).Negate
+ re := item.Regexp
+ negate := item.Negate
var c *object.Commit