summaryrefslogtreecommitdiffstats
path: root/modules/git/pipeline
diff options
context:
space:
mode:
authordelvh <leon@kske.dev>2022-10-24 21:29:17 +0200
committerGitHub <noreply@github.com>2022-10-24 20:29:17 +0100
commit0ebb45cfe7606adf021ad359d6fbfcefc54360a5 (patch)
tree541b75d083213e93bbbfadbdc5d560c739543903 /modules/git/pipeline
parent7c11a73833f3aa9783015e5e13871d3c298d3ef6 (diff)
downloadgitea-0ebb45cfe7606adf021ad359d6fbfcefc54360a5.tar.gz
gitea-0ebb45cfe7606adf021ad359d6fbfcefc54360a5.zip
Replace all instances of fmt.Errorf(%v) with fmt.Errorf(%w) (#21551)
Found using `find . -type f -name '*.go' -print -exec vim {} -c ':%s/fmt\.Errorf(\(.*\)%v\(.*\)err/fmt.Errorf(\1%w\2err/g' -c ':wq' \;` Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Andrew Thornton <art27@cantab.net> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'modules/git/pipeline')
-rw-r--r--modules/git/pipeline/catfile.go6
-rw-r--r--modules/git/pipeline/namerev.go2
-rw-r--r--modules/git/pipeline/revlist.go4
3 files changed, 6 insertions, 6 deletions
diff --git a/modules/git/pipeline/catfile.go b/modules/git/pipeline/catfile.go
index 40dd2bca29..c1d4bd1665 100644
--- a/modules/git/pipeline/catfile.go
+++ b/modules/git/pipeline/catfile.go
@@ -33,7 +33,7 @@ func CatFileBatchCheck(ctx context.Context, shasToCheckReader *io.PipeReader, ca
Stdout: catFileCheckWriter,
Stderr: stderr,
}); err != nil {
- _ = catFileCheckWriter.CloseWithError(fmt.Errorf("git cat-file --batch-check [%s]: %v - %s", tmpBasePath, err, errbuf.String()))
+ _ = catFileCheckWriter.CloseWithError(fmt.Errorf("git cat-file --batch-check [%s]: %w - %s", tmpBasePath, err, errbuf.String()))
}
}
@@ -51,7 +51,7 @@ func CatFileBatchCheckAllObjects(ctx context.Context, catFileCheckWriter *io.Pip
Stderr: stderr,
}); err != nil {
log.Error("git cat-file --batch-check --batch-all-object [%s]: %v - %s", tmpBasePath, err, errbuf.String())
- err = fmt.Errorf("git cat-file --batch-check --batch-all-object [%s]: %v - %s", tmpBasePath, err, errbuf.String())
+ err = fmt.Errorf("git cat-file --batch-check --batch-all-object [%s]: %w - %s", tmpBasePath, err, errbuf.String())
_ = catFileCheckWriter.CloseWithError(err)
errChan <- err
}
@@ -71,7 +71,7 @@ func CatFileBatch(ctx context.Context, shasToBatchReader *io.PipeReader, catFile
Stdin: shasToBatchReader,
Stderr: stderr,
}); err != nil {
- _ = shasToBatchReader.CloseWithError(fmt.Errorf("git rev-list [%s]: %v - %s", tmpBasePath, err, errbuf.String()))
+ _ = shasToBatchReader.CloseWithError(fmt.Errorf("git rev-list [%s]: %w - %s", tmpBasePath, err, errbuf.String()))
}
}
diff --git a/modules/git/pipeline/namerev.go b/modules/git/pipeline/namerev.go
index 8356e70234..85ba7db23e 100644
--- a/modules/git/pipeline/namerev.go
+++ b/modules/git/pipeline/namerev.go
@@ -29,6 +29,6 @@ func NameRevStdin(ctx context.Context, shasToNameReader *io.PipeReader, nameRevS
Stdin: shasToNameReader,
Stderr: stderr,
}); err != nil {
- _ = shasToNameReader.CloseWithError(fmt.Errorf("git name-rev [%s]: %v - %s", tmpBasePath, err, errbuf.String()))
+ _ = shasToNameReader.CloseWithError(fmt.Errorf("git name-rev [%s]: %w - %s", tmpBasePath, err, errbuf.String()))
}
}
diff --git a/modules/git/pipeline/revlist.go b/modules/git/pipeline/revlist.go
index 5f62e85e7f..93142034ec 100644
--- a/modules/git/pipeline/revlist.go
+++ b/modules/git/pipeline/revlist.go
@@ -31,7 +31,7 @@ func RevListAllObjects(ctx context.Context, revListWriter *io.PipeWriter, wg *sy
Stderr: stderr,
}); err != nil {
log.Error("git rev-list --objects --all [%s]: %v - %s", basePath, err, errbuf.String())
- err = fmt.Errorf("git rev-list --objects --all [%s]: %v - %s", basePath, err, errbuf.String())
+ err = fmt.Errorf("git rev-list --objects --all [%s]: %w - %s", basePath, err, errbuf.String())
_ = revListWriter.CloseWithError(err)
errChan <- err
}
@@ -50,7 +50,7 @@ func RevListObjects(ctx context.Context, revListWriter *io.PipeWriter, wg *sync.
Stderr: stderr,
}); err != nil {
log.Error("git rev-list [%s]: %v - %s", tmpBasePath, err, errbuf.String())
- errChan <- fmt.Errorf("git rev-list [%s]: %v - %s", tmpBasePath, err, errbuf.String())
+ errChan <- fmt.Errorf("git rev-list [%s]: %w - %s", tmpBasePath, err, errbuf.String())
}
}