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/batch_reader.go | |
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/batch_reader.go')
-rw-r--r-- | modules/git/batch_reader.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/git/batch_reader.go b/modules/git/batch_reader.go index 7f7272c19e..4cd6cb1217 100644 --- a/modules/git/batch_reader.go +++ b/modules/git/batch_reader.go @@ -32,7 +32,7 @@ type WriteCloserError interface { // This is needed otherwise the git cat-file will hang for invalid repositories. func EnsureValidGitRepository(ctx context.Context, repoPath string) error { stderr := strings.Builder{} - err := NewCommandContext(ctx, "rev-parse"). + err := NewCommand(ctx, "rev-parse"). SetDescription(fmt.Sprintf("%s rev-parse [repo_path: %s]", GitExecutable, repoPath)). RunInDirFullPipeline(repoPath, nil, &stderr, nil) if err != nil { @@ -59,7 +59,7 @@ func CatFileBatchCheck(ctx context.Context, repoPath string) (WriteCloserError, go func() { stderr := strings.Builder{} - err := NewCommandContext(ctx, "cat-file", "--batch-check"). + err := NewCommand(ctx, "cat-file", "--batch-check"). SetDescription(fmt.Sprintf("%s cat-file --batch-check [repo_path: %s] (%s:%d)", GitExecutable, repoPath, filename, line)). RunInDirFullPipeline(repoPath, batchStdoutWriter, &stderr, batchStdinReader) if err != nil { @@ -98,7 +98,7 @@ func CatFileBatch(ctx context.Context, repoPath string) (WriteCloserError, *bufi go func() { stderr := strings.Builder{} - err := NewCommandContext(ctx, "cat-file", "--batch"). + err := NewCommand(ctx, "cat-file", "--batch"). SetDescription(fmt.Sprintf("%s cat-file --batch [repo_path: %s] (%s:%d)", GitExecutable, repoPath, filename, line)). RunInDirFullPipeline(repoPath, batchStdoutWriter, &stderr, batchStdinReader) if err != nil { |