diff options
Diffstat (limited to 'modules/git/pipeline/namerev.go')
-rw-r--r-- | modules/git/pipeline/namerev.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/git/pipeline/namerev.go b/modules/git/pipeline/namerev.go index eebb53b0ca..43f93f8f7e 100644 --- a/modules/git/pipeline/namerev.go +++ b/modules/git/pipeline/namerev.go @@ -6,6 +6,7 @@ package pipeline import ( "bytes" + "context" "fmt" "io" "strings" @@ -15,14 +16,14 @@ import ( ) // NameRevStdin runs name-rev --stdin -func NameRevStdin(shasToNameReader *io.PipeReader, nameRevStdinWriter *io.PipeWriter, wg *sync.WaitGroup, tmpBasePath string) { +func NameRevStdin(ctx context.Context, shasToNameReader *io.PipeReader, nameRevStdinWriter *io.PipeWriter, wg *sync.WaitGroup, tmpBasePath string) { defer wg.Done() defer shasToNameReader.Close() defer nameRevStdinWriter.Close() stderr := new(bytes.Buffer) var errbuf strings.Builder - if err := git.NewCommand("name-rev", "--stdin", "--name-only", "--always").RunInDirFullPipeline(tmpBasePath, nameRevStdinWriter, stderr, shasToNameReader); err != nil { + if err := git.NewCommandContext(ctx, "name-rev", "--stdin", "--name-only", "--always").RunInDirFullPipeline(tmpBasePath, nameRevStdinWriter, stderr, shasToNameReader); err != nil { _ = shasToNameReader.CloseWithError(fmt.Errorf("git name-rev [%s]: %v - %s", tmpBasePath, err, errbuf.String())) } } |