forked from forgejo/forgejo
Delete old git.NewCommand() and use it as git.NewCommandContext() (#18552)
This commit is contained in:
parent
8ae5e6d7fd
commit
3043eb36bf
74 changed files with 258 additions and 263 deletions
|
@ -177,7 +177,7 @@ func generateRepoCommit(ctx context.Context, repo, templateRepo, generateRepo *r
|
|||
}
|
||||
|
||||
repoPath := repo.RepoPath()
|
||||
if stdout, err := git.NewCommandContext(ctx, "remote", "add", "origin", repoPath).
|
||||
if stdout, err := git.NewCommand(ctx, "remote", "add", "origin", repoPath).
|
||||
SetDescription(fmt.Sprintf("generateRepoCommit (git remote add): %s to %s", templateRepoPath, tmpDir)).
|
||||
RunInDirWithEnv(tmpDir, env); err != nil {
|
||||
log.Error("Unable to add %v as remote origin to temporary repo to %s: stdout %s\nError: %v", repo, tmpDir, stdout, err)
|
||||
|
@ -281,7 +281,7 @@ func GenerateRepository(ctx context.Context, doer, owner *user_model.User, templ
|
|||
return generateRepo, fmt.Errorf("checkDaemonExportOK: %v", err)
|
||||
}
|
||||
|
||||
if stdout, err := git.NewCommandContext(ctx, "update-server-info").
|
||||
if stdout, err := git.NewCommand(ctx, "update-server-info").
|
||||
SetDescription(fmt.Sprintf("GenerateRepository(git update-server-info): %s", repoPath)).
|
||||
RunInDir(repoPath); err != nil {
|
||||
log.Error("GenerateRepository(git update-server-info) in %v: Stdout: %s\nError: %v", generateRepo, stdout, err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue