@@ -8,6 +8,7 @@ package pipeline
88import (
99 "bufio"
1010 "bytes"
11+ "context"
1112 "io"
1213 "sort"
1314 "strings"
@@ -17,7 +18,7 @@ import (
1718)
1819
1920// 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 ) {
2122 resultsMap := map [string ]* LFSResult {}
2223 results := make ([]* LFSResult , 0 )
2324
@@ -32,7 +33,7 @@ func FindLFSFile(repo *git.Repository, objectID git.ObjectID) ([]*LFSResult, err
3233
3334 go func () {
3435 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 {
3637 Dir : repo .Path ,
3738 Stdout : revListWriter ,
3839 Stderr : & stderr ,
@@ -46,7 +47,7 @@ func FindLFSFile(repo *git.Repository, objectID git.ObjectID) ([]*LFSResult, err
4647
4748 // Next feed the commits in order into cat-file --batch, followed by their trees and sub trees as necessary.
4849 // 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 )
5051 if err != nil {
5152 return nil , err
5253 }
@@ -201,7 +202,7 @@ func FindLFSFile(repo *git.Repository, objectID git.ObjectID) ([]*LFSResult, err
201202 i ++
202203 }
203204 }()
204- go NameRevStdin (repo . Ctx , shasToNameReader , nameRevStdinWriter , & wg , basePath )
205+ go NameRevStdin (ctx , shasToNameReader , nameRevStdinWriter , & wg , basePath )
205206 go func () {
206207 defer wg .Done ()
207208 defer shasToNameWriter .Close ()
0 commit comments