@@ -8,6 +8,7 @@ package pipeline
8
8
import (
9
9
"bufio"
10
10
"bytes"
11
+ "context"
11
12
"io"
12
13
"sort"
13
14
"strings"
@@ -17,7 +18,7 @@ import (
17
18
)
18
19
19
20
// FindLFSFile finds commits that contain a provided pointer file hash
20
- func FindLFSFile (repo * git.Repository , objectID git.ObjectID ) ([]* LFSResult , error ) {
21
+ func FindLFSFile (ctx context. Context , repo * git.Repository , objectID git.ObjectID ) ([]* LFSResult , error ) {
21
22
resultsMap := map [string ]* LFSResult {}
22
23
results := make ([]* LFSResult , 0 )
23
24
@@ -32,7 +33,7 @@ func FindLFSFile(repo *git.Repository, objectID git.ObjectID) ([]*LFSResult, err
32
33
33
34
go func () {
34
35
stderr := strings.Builder {}
35
- err := git .NewCommand ("rev-list" , "--all" ).Run (repo . Ctx , & git.RunOpts {
36
+ err := git .NewCommand ("rev-list" , "--all" ).Run (ctx , & git.RunOpts {
36
37
Dir : repo .Path ,
37
38
Stdout : revListWriter ,
38
39
Stderr : & stderr ,
@@ -46,7 +47,7 @@ func FindLFSFile(repo *git.Repository, objectID git.ObjectID) ([]*LFSResult, err
46
47
47
48
// Next feed the commits in order into cat-file --batch, followed by their trees and sub trees as necessary.
48
49
// so let's create a batch stdin and stdout
49
- batchStdinWriter , batchReader , cancel , err := repo .CatFileBatch (repo . Ctx )
50
+ batchStdinWriter , batchReader , cancel , err := repo .CatFileBatch (ctx )
50
51
if err != nil {
51
52
return nil , err
52
53
}
@@ -201,7 +202,7 @@ func FindLFSFile(repo *git.Repository, objectID git.ObjectID) ([]*LFSResult, err
201
202
i ++
202
203
}
203
204
}()
204
- go NameRevStdin (repo . Ctx , shasToNameReader , nameRevStdinWriter , & wg , basePath )
205
+ go NameRevStdin (ctx , shasToNameReader , nameRevStdinWriter , & wg , basePath )
205
206
go func () {
206
207
defer wg .Done ()
207
208
defer shasToNameWriter .Close ()
0 commit comments