diff options
author | 6543 <6543@obermui.de> | 2022-02-06 20:01:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-06 20:01:47 +0100 |
commit | 3043eb36bfcd7ddf29202b958b91942826a8182b (patch) | |
tree | f6bfcb38648f07ff8132558ff826b8b1aac003ec /modules/git/pipeline | |
parent | 8ae5e6d7fdd577ebf0807bf33a4cdeef35d254d9 (diff) | |
download | gitea-3043eb36bfcd7ddf29202b958b91942826a8182b.tar.gz gitea-3043eb36bfcd7ddf29202b958b91942826a8182b.zip |
Delete old git.NewCommand() and use it as git.NewCommandContext() (#18552)
Diffstat (limited to 'modules/git/pipeline')
-rw-r--r-- | modules/git/pipeline/catfile.go | 6 | ||||
-rw-r--r-- | modules/git/pipeline/lfs_nogogit.go | 2 | ||||
-rw-r--r-- | modules/git/pipeline/namerev.go | 2 | ||||
-rw-r--r-- | modules/git/pipeline/revlist.go | 4 |
4 files changed, 7 insertions, 7 deletions
diff --git a/modules/git/pipeline/catfile.go b/modules/git/pipeline/catfile.go index 0ce5b5e06e..15c3396ff5 100644 --- a/modules/git/pipeline/catfile.go +++ b/modules/git/pipeline/catfile.go @@ -26,7 +26,7 @@ func CatFileBatchCheck(ctx context.Context, shasToCheckReader *io.PipeReader, ca stderr := new(bytes.Buffer) var errbuf strings.Builder - cmd := git.NewCommandContext(ctx, "cat-file", "--batch-check") + cmd := git.NewCommand(ctx, "cat-file", "--batch-check") if err := cmd.RunInDirFullPipeline(tmpBasePath, catFileCheckWriter, stderr, shasToCheckReader); err != nil { _ = catFileCheckWriter.CloseWithError(fmt.Errorf("git cat-file --batch-check [%s]: %v - %s", tmpBasePath, err, errbuf.String())) } @@ -39,7 +39,7 @@ func CatFileBatchCheckAllObjects(ctx context.Context, catFileCheckWriter *io.Pip stderr := new(bytes.Buffer) var errbuf strings.Builder - cmd := git.NewCommandContext(ctx, "cat-file", "--batch-check", "--batch-all-objects") + cmd := git.NewCommand(ctx, "cat-file", "--batch-check", "--batch-all-objects") if err := cmd.RunInDirPipeline(tmpBasePath, catFileCheckWriter, 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()) @@ -56,7 +56,7 @@ func CatFileBatch(ctx context.Context, shasToBatchReader *io.PipeReader, catFile stderr := new(bytes.Buffer) var errbuf strings.Builder - if err := git.NewCommandContext(ctx, "cat-file", "--batch").RunInDirFullPipeline(tmpBasePath, catFileBatchWriter, stderr, shasToBatchReader); err != nil { + if err := git.NewCommand(ctx, "cat-file", "--batch").RunInDirFullPipeline(tmpBasePath, catFileBatchWriter, stderr, shasToBatchReader); err != nil { _ = shasToBatchReader.CloseWithError(fmt.Errorf("git rev-list [%s]: %v - %s", tmpBasePath, err, errbuf.String())) } } diff --git a/modules/git/pipeline/lfs_nogogit.go b/modules/git/pipeline/lfs_nogogit.go index 3b993606ac..90ffef16bb 100644 --- a/modules/git/pipeline/lfs_nogogit.go +++ b/modules/git/pipeline/lfs_nogogit.go @@ -53,7 +53,7 @@ func FindLFSFile(repo *git.Repository, hash git.SHA1) ([]*LFSResult, error) { go func() { stderr := strings.Builder{} - err := git.NewCommandContext(repo.Ctx, "rev-list", "--all").RunInDirPipeline(repo.Path, revListWriter, &stderr) + err := git.NewCommand(repo.Ctx, "rev-list", "--all").RunInDirPipeline(repo.Path, revListWriter, &stderr) if err != nil { _ = revListWriter.CloseWithError(git.ConcatenateError(err, (&stderr).String())) } else { diff --git a/modules/git/pipeline/namerev.go b/modules/git/pipeline/namerev.go index 43f93f8f7e..84006e9005 100644 --- a/modules/git/pipeline/namerev.go +++ b/modules/git/pipeline/namerev.go @@ -23,7 +23,7 @@ func NameRevStdin(ctx context.Context, shasToNameReader *io.PipeReader, nameRevS stderr := new(bytes.Buffer) var errbuf strings.Builder - if err := git.NewCommandContext(ctx, "name-rev", "--stdin", "--name-only", "--always").RunInDirFullPipeline(tmpBasePath, nameRevStdinWriter, stderr, shasToNameReader); err != nil { + if err := git.NewCommand(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())) } } diff --git a/modules/git/pipeline/revlist.go b/modules/git/pipeline/revlist.go index 373ceea1fb..75dc676f36 100644 --- a/modules/git/pipeline/revlist.go +++ b/modules/git/pipeline/revlist.go @@ -24,7 +24,7 @@ func RevListAllObjects(ctx context.Context, revListWriter *io.PipeWriter, wg *sy stderr := new(bytes.Buffer) var errbuf strings.Builder - cmd := git.NewCommandContext(ctx, "rev-list", "--objects", "--all") + cmd := git.NewCommand(ctx, "rev-list", "--objects", "--all") if err := cmd.RunInDirPipeline(basePath, revListWriter, 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()) @@ -39,7 +39,7 @@ func RevListObjects(ctx context.Context, revListWriter *io.PipeWriter, wg *sync. defer revListWriter.Close() stderr := new(bytes.Buffer) var errbuf strings.Builder - cmd := git.NewCommandContext(ctx, "rev-list", "--objects", headSHA, "--not", baseSHA) + cmd := git.NewCommand(ctx, "rev-list", "--objects", headSHA, "--not", baseSHA) if err := cmd.RunInDirPipeline(tmpBasePath, revListWriter, 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()) |