diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2022-04-01 10:55:30 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-01 10:55:30 +0800 |
commit | 124b072f0b69650baff086b9688d198f5a6761af (patch) | |
tree | fa18f7930053a8408e124875b5dec20e0309332b /modules/indexer/code/elastic_search.go | |
parent | 3a73645502392110369b5d78fa2c9136e77e4aa2 (diff) | |
download | gitea-124b072f0b69650baff086b9688d198f5a6761af.tar.gz gitea-124b072f0b69650baff086b9688d198f5a6761af.zip |
Remove `git.Command.Run` and `git.Command.RunInDir*` (#19280)
Follows #19266, #8553, Close #18553, now there are only three `Run..(&RunOpts{})` functions.
* before: `stdout, err := RunInDir(path)`
* now: `stdout, _, err := RunStdString(&git.RunOpts{Dir:path})`
Diffstat (limited to 'modules/indexer/code/elastic_search.go')
-rw-r--r-- | modules/indexer/code/elastic_search.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/indexer/code/elastic_search.go b/modules/indexer/code/elastic_search.go index dd6ba19995..7263f27657 100644 --- a/modules/indexer/code/elastic_search.go +++ b/modules/indexer/code/elastic_search.go @@ -220,10 +220,10 @@ func (b *ElasticSearchIndexer) addUpdate(ctx context.Context, batchWriter git.Wr } size := update.Size - + var err error if !update.Sized { - stdout, err := git.NewCommand(ctx, "cat-file", "-s", update.BlobSha). - RunInDir(repo.RepoPath()) + var stdout string + stdout, _, err = git.NewCommand(ctx, "cat-file", "-s", update.BlobSha).RunStdString(&git.RunOpts{Dir: repo.RepoPath()}) if err != nil { return nil, err } @@ -240,7 +240,7 @@ func (b *ElasticSearchIndexer) addUpdate(ctx context.Context, batchWriter git.Wr return nil, err } - _, _, size, err := git.ReadBatchLine(batchReader) + _, _, size, err = git.ReadBatchLine(batchReader) if err != nil { return nil, err } |