File tree Expand file tree Collapse file tree 3 files changed +7
-31
lines changed Expand file tree Collapse file tree 3 files changed +7
-31
lines changed Original file line number Diff line number Diff line change @@ -97,7 +97,8 @@ var todosCmd = &cobra.Command{
97
97
handleError (err , s )
98
98
99
99
} else {
100
- todos .WriteTodos (foundToDos , os .Stdout )
100
+ err := todos .WriteTodos (foundToDos , os .Stdout )
101
+ handleError (err , s )
101
102
}
102
103
103
104
},
Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ func SearchCommit(commit *object.Commit, cb func(*Comment)) error {
116
116
return err
117
117
}
118
118
defer fileIter .Close ()
119
- fileIter .ForEach (func (file * object.File ) error {
119
+ err = fileIter .ForEach (func (file * object.File ) error {
120
120
if file .Mode .IsFile () {
121
121
wg .Add (1 )
122
122
go func () {
@@ -138,6 +138,10 @@ func SearchCommit(commit *object.Commit, cb func(*Comment)) error {
138
138
return nil
139
139
})
140
140
141
+ if err != nil {
142
+ return err
143
+ }
144
+
141
145
wg .Wait ()
142
146
return nil
143
147
}
Original file line number Diff line number Diff line change 1
1
package todos
2
2
3
3
import (
4
- "bufio"
5
4
"context"
6
5
"strings"
7
6
8
7
"github.com/augmentable-dev/tickgit/pkg/blame"
9
8
"github.com/augmentable-dev/tickgit/pkg/comments"
10
9
"github.com/dustin/go-humanize"
11
- "gopkg.in/src-d/go-git.v4/plumbing/object"
12
10
)
13
11
14
12
// ToDo represents a ToDo item
@@ -100,33 +98,6 @@ func (t ToDos) CountWithCommits() (count int) {
100
98
return count
101
99
}
102
100
103
- func (t * ToDo ) existsInCommit (commit * object.Commit ) (bool , error ) {
104
- f , err := commit .File (t .FilePath )
105
- if err != nil {
106
- if err == object .ErrFileNotFound {
107
- return false , nil
108
- }
109
- return false , err
110
- }
111
- r , err := f .Reader ()
112
- if err != nil {
113
- return false , err
114
- }
115
- defer r .Close ()
116
- s := bufio .NewScanner (r )
117
- for s .Scan () {
118
- line := s .Text ()
119
- if strings .Contains (line , t .Comment .String ()) {
120
- return true , nil
121
- }
122
- }
123
- err = s .Err ()
124
- if err != nil {
125
- return false , err
126
- }
127
- return false , nil
128
- }
129
-
130
101
// FindBlame sets the blame information on each todo in a set of todos
131
102
func (t * ToDos ) FindBlame (ctx context.Context , dir string ) error {
132
103
fileMap := make (map [string ]ToDos )
You can’t perform that action at this time.
0 commit comments