mirror of
				https://github.com/go-gitea/gitea
				synced 2025-10-30 19:08:37 +00:00 
			
		
		
		
	Refactor git command arguments and make all arguments to be safe to be used (#21535)
Follow #21464 Make all git command arguments strictly safe. Most changes are one-to-one replacing, keep all existing logic.
This commit is contained in:
		| @@ -130,7 +130,7 @@ func ForkRepository(ctx context.Context, doer, owner *user_model.User, opts Fork | ||||
|  | ||||
| 		repoPath := repo_model.RepoPath(owner.Name, repo.Name) | ||||
| 		if stdout, _, err := git.NewCommand(txCtx, | ||||
| 			"clone", "--bare", oldRepoPath, repoPath). | ||||
| 			"clone", "--bare").AddDynamicArguments(oldRepoPath, repoPath). | ||||
| 			SetDescription(fmt.Sprintf("ForkRepository(git clone): %s to %s", opts.BaseRepo.FullName(), repo.FullName())). | ||||
| 			RunStdBytes(&git.RunOpts{Timeout: 10 * time.Minute}); err != nil { | ||||
| 			log.Error("Fork Repository (git clone) Failed for %v (from %v):\nStdout: %s\nError: %v", repo, opts.BaseRepo, stdout, err) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user