aboutsummaryrefslogtreecommitdiffstats
path: root/modules/indexer/code/git.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/indexer/code/git.go')
-rw-r--r--modules/indexer/code/git.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/indexer/code/git.go b/modules/indexer/code/git.go
index ae73f5690d..62444f6251 100644
--- a/modules/indexer/code/git.go
+++ b/modules/indexer/code/git.go
@@ -29,7 +29,7 @@ type repoChanges struct {
}
func getDefaultBranchSha(ctx context.Context, repo *repo_model.Repository) (string, error) {
- stdout, err := git.NewCommandContext(ctx, "show-ref", "-s", git.BranchPrefix+repo.DefaultBranch).RunInDir(repo.RepoPath())
+ stdout, err := git.NewCommand(ctx, "show-ref", "-s", git.BranchPrefix+repo.DefaultBranch).RunInDir(repo.RepoPath())
if err != nil {
return "", err
}
@@ -92,7 +92,7 @@ func parseGitLsTreeOutput(stdout []byte) ([]fileUpdate, error) {
// genesisChanges get changes to add repo to the indexer for the first time
func genesisChanges(ctx context.Context, repo *repo_model.Repository, revision string) (*repoChanges, error) {
var changes repoChanges
- stdout, err := git.NewCommandContext(ctx, "ls-tree", "--full-tree", "-l", "-r", revision).
+ stdout, err := git.NewCommand(ctx, "ls-tree", "--full-tree", "-l", "-r", revision).
RunInDirBytes(repo.RepoPath())
if err != nil {
return nil, err
@@ -103,7 +103,7 @@ func genesisChanges(ctx context.Context, repo *repo_model.Repository, revision s
// nonGenesisChanges get changes since the previous indexer update
func nonGenesisChanges(ctx context.Context, repo *repo_model.Repository, revision string) (*repoChanges, error) {
- diffCmd := git.NewCommandContext(ctx, "diff", "--name-status",
+ diffCmd := git.NewCommand(ctx, "diff", "--name-status",
repo.CodeIndexerStatus.CommitSha, revision)
stdout, err := diffCmd.RunInDir(repo.RepoPath())
if err != nil {
@@ -167,7 +167,7 @@ func nonGenesisChanges(ctx context.Context, repo *repo_model.Repository, revisio
}
}
- cmd := git.NewCommandContext(ctx, "ls-tree", "--full-tree", "-l", revision, "--")
+ cmd := git.NewCommand(ctx, "ls-tree", "--full-tree", "-l", revision, "--")
cmd.AddArguments(updatedFilenames...)
lsTreeStdout, err := cmd.RunInDirBytes(repo.RepoPath())
if err != nil {