mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-03 21:08:25 +00:00 
			
		
		
		
	Delete old git.NewCommand() and use it as git.NewCommandContext() (#18552)
This commit is contained in:
		@@ -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)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user