@@ -8,8 +8,10 @@ import (
88 "bufio"
99 "bytes"
1010 "context"
11+ "fmt"
1112 "io"
1213 "math"
14+ "runtime"
1315 "strconv"
1416 "strings"
1517
@@ -40,9 +42,14 @@ func CatFileBatchCheck(repoPath string) (WriteCloserError, *bufio.Reader, func()
4042 <- closed
4143 }
4244
45+ _ , filename , line , _ := runtime .Caller (2 )
46+ filename = strings .TrimPrefix (filename , callerPrefix )
47+
4348 go func () {
4449 stderr := strings.Builder {}
45- err := NewCommandContext (ctx , "cat-file" , "--batch-check" ).RunInDirFullPipeline (repoPath , batchStdoutWriter , & stderr , batchStdinReader )
50+ err := NewCommandContext (ctx , "cat-file" , "--batch-check" ).
51+ SetDescription (fmt .Sprintf ("%s cat-file --batch-check [repo_path: %s] (%s:%d)" , GitExecutable , repoPath , filename , line )).
52+ RunInDirFullPipeline (repoPath , batchStdoutWriter , & stderr , batchStdinReader )
4653 if err != nil {
4754 _ = batchStdoutWriter .CloseWithError (ConcatenateError (err , (& stderr ).String ()))
4855 _ = batchStdinReader .CloseWithError (ConcatenateError (err , (& stderr ).String ()))
@@ -76,9 +83,14 @@ func CatFileBatch(repoPath string) (WriteCloserError, *bufio.Reader, func()) {
7683 <- closed
7784 }
7885
86+ _ , filename , line , _ := runtime .Caller (2 )
87+ filename = strings .TrimPrefix (filename , callerPrefix )
88+
7989 go func () {
8090 stderr := strings.Builder {}
81- err := NewCommandContext (ctx , "cat-file" , "--batch" ).RunInDirFullPipeline (repoPath , batchStdoutWriter , & stderr , batchStdinReader )
91+ err := NewCommandContext (ctx , "cat-file" , "--batch" ).
92+ SetDescription (fmt .Sprintf ("%s cat-file --batch [repo_path: %s] (%s:%d)" , GitExecutable , repoPath , filename , line )).
93+ RunInDirFullPipeline (repoPath , batchStdoutWriter , & stderr , batchStdinReader )
8294 if err != nil {
8395 _ = batchStdoutWriter .CloseWithError (ConcatenateError (err , (& stderr ).String ()))
8496 _ = batchStdinReader .CloseWithError (ConcatenateError (err , (& stderr ).String ()))
@@ -292,3 +304,10 @@ func ParseTreeLine(rd *bufio.Reader, modeBuf, fnameBuf, shaBuf []byte) (mode, fn
292304 sha = shaBuf
293305 return
294306}
307+
308+ var callerPrefix string
309+
310+ func init () {
311+ _ , filename , _ , _ := runtime .Caller (0 )
312+ callerPrefix = strings .TrimSuffix (filename , "modules/git/batch_reader.go" )
313+ }
0 commit comments