@@ -27,7 +27,13 @@ func CatFileBatchCheck(ctx context.Context, shasToCheckReader *io.PipeReader, ca
27
27
stderr := new (bytes.Buffer )
28
28
var errbuf strings.Builder
29
29
cmd := git .NewCommand (ctx , "cat-file" , "--batch-check" )
30
- if err := cmd .RunInDirFullPipeline (tmpBasePath , catFileCheckWriter , stderr , shasToCheckReader ); err != nil {
30
+ if err := cmd .RunWithContext (& git.RunContext {
31
+ Timeout : - 1 ,
32
+ Dir : tmpBasePath ,
33
+ Stdin : shasToCheckReader ,
34
+ Stdout : catFileCheckWriter ,
35
+ Stderr : stderr ,
36
+ }); err != nil {
31
37
_ = catFileCheckWriter .CloseWithError (fmt .Errorf ("git cat-file --batch-check [%s]: %v - %s" , tmpBasePath , err , errbuf .String ()))
32
38
}
33
39
}
@@ -40,7 +46,12 @@ func CatFileBatchCheckAllObjects(ctx context.Context, catFileCheckWriter *io.Pip
40
46
stderr := new (bytes.Buffer )
41
47
var errbuf strings.Builder
42
48
cmd := git .NewCommand (ctx , "cat-file" , "--batch-check" , "--batch-all-objects" )
43
- if err := cmd .RunInDirPipeline (tmpBasePath , catFileCheckWriter , stderr ); err != nil {
49
+ if err := cmd .RunWithContext (& git.RunContext {
50
+ Timeout : - 1 ,
51
+ Dir : tmpBasePath ,
52
+ Stdout : catFileCheckWriter ,
53
+ Stderr : stderr ,
54
+ }); err != nil {
44
55
log .Error ("git cat-file --batch-check --batch-all-object [%s]: %v - %s" , tmpBasePath , err , errbuf .String ())
45
56
err = fmt .Errorf ("git cat-file --batch-check --batch-all-object [%s]: %v - %s" , tmpBasePath , err , errbuf .String ())
46
57
_ = catFileCheckWriter .CloseWithError (err )
@@ -56,7 +67,13 @@ func CatFileBatch(ctx context.Context, shasToBatchReader *io.PipeReader, catFile
56
67
57
68
stderr := new (bytes.Buffer )
58
69
var errbuf strings.Builder
59
- if err := git .NewCommand (ctx , "cat-file" , "--batch" ).RunInDirFullPipeline (tmpBasePath , catFileBatchWriter , stderr , shasToBatchReader ); err != nil {
70
+ if err := git .NewCommand (ctx , "cat-file" , "--batch" ).RunWithContext (& git.RunContext {
71
+ Timeout : - 1 ,
72
+ Dir : tmpBasePath ,
73
+ Stdout : catFileBatchWriter ,
74
+ Stdin : shasToBatchReader ,
75
+ Stderr : stderr ,
76
+ }); err != nil {
60
77
_ = shasToBatchReader .CloseWithError (fmt .Errorf ("git rev-list [%s]: %v - %s" , tmpBasePath , err , errbuf .String ()))
61
78
}
62
79
}
0 commit comments