@@ -21,7 +21,6 @@ import (
2121 git_model "code.gitea.io/gitea/models/git"
2222 repo_model "code.gitea.io/gitea/models/repo"
2323 "code.gitea.io/gitea/modules/git"
24- "code.gitea.io/gitea/modules/git/gitcmd"
2524 "code.gitea.io/gitea/modules/gitrepo"
2625 "code.gitea.io/gitea/modules/glob"
2726 "code.gitea.io/gitea/modules/log"
@@ -216,19 +215,6 @@ func processGiteaTemplateFile(ctx context.Context, tmpDir string, templateRepo,
216215}
217216
218217func generateRepoCommit (ctx context.Context , repo , templateRepo , generateRepo * repo_model.Repository , tmpDir string ) error {
219- commitTimeStr := time .Now ().Format (time .RFC3339 )
220- authorSig := repo .Owner .NewGitSig ()
221-
222- // Because this may call hooks we should pass in the environment
223- env := append (os .Environ (),
224- "GIT_AUTHOR_NAME=" + authorSig .Name ,
225- "GIT_AUTHOR_EMAIL=" + authorSig .Email ,
226- "GIT_AUTHOR_DATE=" + commitTimeStr ,
227- "GIT_COMMITTER_NAME=" + authorSig .Name ,
228- "GIT_COMMITTER_EMAIL=" + authorSig .Email ,
229- "GIT_COMMITTER_DATE=" + commitTimeStr ,
230- )
231-
232218 // Clone to temporary path and do the init commit.
233219 if err := gitrepo .CloneRepoToLocal (ctx , templateRepo , tmpDir , git.CloneRepoOptions {
234220 Depth : 1 ,
@@ -264,15 +250,6 @@ func generateRepoCommit(ctx context.Context, repo, templateRepo, generateRepo *r
264250 return err
265251 }
266252
267- if stdout , _ , err := gitcmd .NewCommand ("remote" , "add" , "origin" ).
268- AddDynamicArguments (repo .RepoPath ()).
269- WithDir (tmpDir ).
270- WithEnv (env ).
271- RunStdString (ctx ); err != nil {
272- log .Error ("Unable to add %v as remote origin to temporary repo to %s: stdout %s\n Error: %v" , repo , tmpDir , stdout , err )
273- return fmt .Errorf ("git remote add: %w" , err )
274- }
275-
276253 if err = git .AddTemplateSubmoduleIndexes (ctx , tmpDir , submodules ); err != nil {
277254 return fmt .Errorf ("failed to add submodules: %v" , err )
278255 }
0 commit comments