refactor: remove unnecessary git command wrapper functions (#38531)

Removed `gitrepo.RunCmd*` functions, because gitcmd.Command works with
Repository directly.

Move some "local filesystem" related function into "localfs.go"
This commit is contained in:
wxiaoguang
2026-07-20 11:17:25 +08:00
committed by GitHub
parent 730b6f2daf
commit 775e3bdb34
53 changed files with 269 additions and 284 deletions
+1 -2
View File
@@ -16,7 +16,6 @@ import (
"gitea.dev/modules/charset"
"gitea.dev/modules/git"
"gitea.dev/modules/git/gitcmd"
"gitea.dev/modules/gitrepo"
"gitea.dev/modules/indexer"
path_filter "gitea.dev/modules/indexer/code/bleve/token/path"
"gitea.dev/modules/indexer/code/internal"
@@ -163,7 +162,7 @@ func (b *Indexer) addUpdate(ctx context.Context, catFileBatch git.CatFileBatch,
var err error
if !update.Sized {
var stdout string
stdout, _, err = gitrepo.RunCmdString(ctx, repo, gitcmd.NewCommand("cat-file", "-s").AddDynamicArguments(update.BlobSha))
stdout, _, err = gitcmd.NewCommand("cat-file", "-s").AddDynamicArguments(update.BlobSha).WithRepo(repo).RunStdString(ctx)
if err != nil {
return err
}