File tree 10 files changed +54
-36
lines changed
10 files changed +54
-36
lines changed Original file line number Diff line number Diff line change @@ -106,13 +106,15 @@ func (r *blobsTable) PartitionRows(
106
106
r .filters ,
107
107
r .handledColumns (),
108
108
func (selectors selectors ) (sql.RowIter , error ) {
109
- hashes , err := selectors .textValues ("blob_hash" )
109
+ var hashes []string
110
+ hashes , err = selectors .textValues ("blob_hash" )
110
111
if err != nil {
111
112
return nil , err
112
113
}
113
114
114
115
if r .index != nil {
115
- indexValues , err := r .index .Values (p )
116
+ var indexValues sql.IndexValueIter
117
+ indexValues , err = r .index .Values (p )
116
118
if err != nil {
117
119
return nil , err
118
120
}
Original file line number Diff line number Diff line change @@ -78,7 +78,8 @@ func (t *commitBlobsTable) PartitionRows(
78
78
t .filters ,
79
79
t .handledColumns (),
80
80
func (selectors selectors ) (sql.RowIter , error ) {
81
- repos , err := selectors .textValues ("repository_id" )
81
+ var repos []string
82
+ repos , err = selectors .textValues ("repository_id" )
82
83
if err != nil {
83
84
return nil , err
84
85
}
@@ -87,7 +88,8 @@ func (t *commitBlobsTable) PartitionRows(
87
88
return noRows , nil
88
89
}
89
90
90
- commits , err := selectors .textValues ("commit_hash" )
91
+ var commits []string
92
+ commits , err = selectors .textValues ("commit_hash" )
91
93
if err != nil {
92
94
return nil , err
93
95
}
Original file line number Diff line number Diff line change @@ -84,7 +84,8 @@ func (t *commitFilesTable) PartitionRows(
84
84
t .filters ,
85
85
t .handledColumns (),
86
86
func (selectors selectors ) (sql.RowIter , error ) {
87
- repos , err := selectors .textValues ("repository_id" )
87
+ var repos []string
88
+ repos , err = selectors .textValues ("repository_id" )
88
89
if err != nil {
89
90
return nil , err
90
91
}
@@ -93,12 +94,14 @@ func (t *commitFilesTable) PartitionRows(
93
94
return noRows , nil
94
95
}
95
96
96
- hashes , err := selectors .textValues ("commit_hash" )
97
+ var hashes []string
98
+ hashes , err = selectors .textValues ("commit_hash" )
97
99
if err != nil {
98
100
return nil , err
99
101
}
100
102
101
- paths , err := selectors .textValues ("file_path" )
103
+ var paths []string
104
+ paths , err = selectors .textValues ("file_path" )
102
105
if err != nil {
103
106
return nil , err
104
107
}
Original file line number Diff line number Diff line change @@ -79,7 +79,8 @@ func (t *commitTreesTable) PartitionRows(
79
79
t .filters ,
80
80
t .handledColumns (),
81
81
func (selectors selectors ) (sql.RowIter , error ) {
82
- repos , err := selectors .textValues ("repository_id" )
82
+ var repos []string
83
+ repos , err = selectors .textValues ("repository_id" )
83
84
if err != nil {
84
85
return nil , err
85
86
}
@@ -88,7 +89,8 @@ func (t *commitTreesTable) PartitionRows(
88
89
return noRows , nil
89
90
}
90
91
91
- hashes , err := selectors .textValues ("commit_hash" )
92
+ var hashes []string
93
+ hashes , err = selectors .textValues ("commit_hash" )
92
94
if err != nil {
93
95
return nil , err
94
96
}
Original file line number Diff line number Diff line change @@ -90,18 +90,21 @@ func (r *commitsTable) PartitionRows(
90
90
r .filters ,
91
91
r .handledColumns (),
92
92
func (selectors selectors ) (sql.RowIter , error ) {
93
- hashes , err := selectors .textValues ("commit_hash" )
93
+ var hashes []string
94
+ hashes , err = selectors .textValues ("commit_hash" )
94
95
if err != nil {
95
96
return nil , err
96
97
}
97
98
98
99
if r .index != nil {
99
- indexValues , err := r .index .Values (p )
100
+ var indexValues sql.IndexValueIter
101
+ indexValues , err = r .index .Values (p )
100
102
if err != nil {
101
103
return nil , err
102
104
}
103
105
104
- s , err := getSession (ctx )
106
+ var s * Session
107
+ s , err = getSession (ctx )
105
108
if err != nil {
106
109
return nil , err
107
110
}
@@ -243,7 +246,7 @@ func (i *commitIter) Next() (*object.Commit, error) {
243
246
var err error
244
247
245
248
if i .ref == nil {
246
- if err : = i .loadNextRef (); err != nil {
249
+ if err = i .loadNextRef (); err != nil {
247
250
return nil , err
248
251
}
249
252
Original file line number Diff line number Diff line change @@ -79,7 +79,8 @@ func (r *filesTable) PartitionRows(
79
79
r .filters ,
80
80
r .handledColumns (),
81
81
func (selectors selectors ) (sql.RowIter , error ) {
82
- repos , err := selectors .textValues ("repository_id" )
82
+ var repos []string
83
+ repos , err = selectors .textValues ("repository_id" )
83
84
if err != nil {
84
85
return nil , err
85
86
}
@@ -88,28 +89,33 @@ func (r *filesTable) PartitionRows(
88
89
return noRows , nil
89
90
}
90
91
91
- treeHashes , err := selectors .textValues ("tree_hash" )
92
+ var treeHashes []string
93
+ treeHashes , err = selectors .textValues ("tree_hash" )
92
94
if err != nil {
93
95
return nil , err
94
96
}
95
97
96
- blobHashes , err := selectors .textValues ("blob_hash" )
98
+ var blobHashes []string
99
+ blobHashes , err = selectors .textValues ("blob_hash" )
97
100
if err != nil {
98
101
return nil , err
99
102
}
100
103
101
- filePaths , err := selectors .textValues ("file_path" )
104
+ var filePaths []string
105
+ filePaths , err = selectors .textValues ("file_path" )
102
106
if err != nil {
103
107
return nil , err
104
108
}
105
109
106
110
if r .index != nil {
107
- values , err := r .index .Values (p )
111
+ var values sql.IndexValueIter
112
+ values , err = r .index .Values (p )
108
113
if err != nil {
109
114
return nil , err
110
115
}
111
116
112
- session , err := getSession (ctx )
117
+ var session * Session
118
+ session , err = getSession (ctx )
113
119
if err != nil {
114
120
return nil , err
115
121
}
Original file line number Diff line number Diff line change @@ -171,8 +171,8 @@ func handledFilters(
171
171
// table.
172
172
var hasOtherFields bool
173
173
expression .Inspect (f , func (e sql.Expression ) bool {
174
- if e , ok := e .(* expression.GetField ); ok {
175
- if e .Table () != tableName {
174
+ if gf , ok := e .(* expression.GetField ); ok {
175
+ if gf .Table () != tableName {
176
176
hasOtherFields = true
177
177
}
178
178
}
Original file line number Diff line number Diff line change @@ -4,15 +4,15 @@ import (
4
4
"io"
5
5
"os"
6
6
7
- errors "gopkg.in/src-d/go-errors.v1"
7
+ "gopkg.in/src-d/go-errors.v1"
8
8
"gopkg.in/src-d/go-git.v4/plumbing/object"
9
9
"gopkg.in/src-d/go-git.v4/plumbing/storer"
10
10
"gopkg.in/src-d/go-git.v4/storage/filesystem"
11
11
"gopkg.in/src-d/go-git.v4/storage/filesystem/dotgit"
12
12
"gopkg.in/src-d/go-git.v4/utils/ioutil"
13
13
14
14
"gopkg.in/src-d/go-billy-siva.v4"
15
- billy "gopkg.in/src-d/go-billy.v4"
15
+ "gopkg.in/src-d/go-billy.v4"
16
16
"gopkg.in/src-d/go-git.v4/plumbing"
17
17
"gopkg.in/src-d/go-git.v4/plumbing/format/idxfile"
18
18
"gopkg.in/src-d/go-git.v4/plumbing/format/objfile"
@@ -244,10 +244,6 @@ func newRepoObjectDecoder(
244
244
}
245
245
246
246
packfile := packfile .NewPackfile (idx , fs , packf )
247
- if err != nil {
248
- _ = packf .Close ()
249
- return nil , err
250
- }
251
247
252
248
return & repoObjectDecoder {
253
249
repo : repo .ID (),
Original file line number Diff line number Diff line change @@ -82,7 +82,8 @@ func (t *refCommitsTable) PartitionRows(
82
82
t .filters ,
83
83
t .handledColumns (),
84
84
func (selectors selectors ) (sql.RowIter , error ) {
85
- repos , err := selectors .textValues ("repository_id" )
85
+ var repos []string
86
+ repos , err = selectors .textValues ("repository_id" )
86
87
if err != nil {
87
88
return nil , err
88
89
}
@@ -91,7 +92,8 @@ func (t *refCommitsTable) PartitionRows(
91
92
return noRows , nil
92
93
}
93
94
94
- names , err := selectors .textValues ("ref_name" )
95
+ var names []string
96
+ names , err = selectors .textValues ("ref_name" )
95
97
if err != nil {
96
98
return nil , err
97
99
}
@@ -290,10 +292,10 @@ func (i *refCommitsRowIter) next() (sql.Row, error) {
290
292
if i .commits == nil {
291
293
var ref * plumbing.Reference
292
294
if i .head == nil {
293
- var err error
294
- ref , err = i .refs .Next ()
295
- if err != nil {
296
- if err == io .EOF {
295
+ var err_ error
296
+ ref , err_ = i .refs .Next ()
297
+ if err_ != nil {
298
+ if err_ == io .EOF {
297
299
i .repo .Close ()
298
300
return nil , io .EOF
299
301
}
@@ -303,7 +305,7 @@ func (i *refCommitsRowIter) next() (sql.Row, error) {
303
305
}
304
306
305
307
i .repo .Close ()
306
- return nil , err
308
+ return nil , err_
307
309
}
308
310
} else {
309
311
ref = plumbing .NewHashReference (plumbing .ReferenceName ("HEAD" ), i .head .Hash ())
Original file line number Diff line number Diff line change @@ -84,12 +84,14 @@ func (r *referencesTable) PartitionRows(
84
84
r .filters ,
85
85
r .handledColumns (),
86
86
func (selectors selectors ) (sql.RowIter , error ) {
87
- hashes , err := selectors .textValues ("commit_hash" )
87
+ var hashes []string
88
+ hashes , err = selectors .textValues ("commit_hash" )
88
89
if err != nil {
89
90
return nil , err
90
91
}
91
92
92
- names , err := selectors .textValues ("ref_name" )
93
+ var names []string
94
+ names , err = selectors .textValues ("ref_name" )
93
95
if err != nil {
94
96
return nil , err
95
97
}
You can’t perform that action at this time.
0 commit comments