chore: replace pkg/errors with cockroachdb/errors (#8098)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: unknwon <2946214+unknwon@users.noreply.github.com>
This commit is contained in:
Copilot
2026-01-22 08:20:53 -05:00
committed by GitHub
parent ae59787ff5
commit 4ee706b2bf
96 changed files with 605 additions and 564 deletions

View File

@@ -2,12 +2,12 @@ package gitutil
import (
"bytes"
"fmt"
"html"
"html/template"
"io"
"sync"
"github.com/cockroachdb/errors"
"github.com/sergi/go-diff/diffmatchpatch"
"golang.org/x/net/html/charset"
"golang.org/x/text/transform"
@@ -176,7 +176,7 @@ func ParseDiff(r io.Reader, maxFiles, maxFileLines, maxLineChars int) (*Diff, er
result := <-done
if result.Err != nil {
return nil, fmt.Errorf("stream parse diff: %v", result.Err)
return nil, errors.Newf("stream parse diff: %v", result.Err)
}
return NewDiff(result.Diff), nil
}
@@ -185,7 +185,7 @@ func ParseDiff(r io.Reader, maxFiles, maxFileLines, maxLineChars int) (*Diff, er
func RepoDiff(repo *git.Repository, rev string, maxFiles, maxFileLines, maxLineChars int, opts ...git.DiffOptions) (*Diff, error) {
diff, err := repo.Diff(rev, maxFiles, maxFileLines, maxLineChars, opts...)
if err != nil {
return nil, fmt.Errorf("get diff: %v", err)
return nil, errors.Newf("get diff: %v", err)
}
return NewDiff(diff), nil
}