mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-05-31 03:00:03 +02: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:
parent
4eeea7b30e
commit
dcd9fc7ee8
71 changed files with 425 additions and 391 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue