@@ -52,7 +52,7 @@ type CreateRepoOptions struct {
5252 ObjectFormatName string
5353}
5454
55- func prepareRepoCommit (ctx context.Context , repo * repo_model.Repository , tmpDir , repoPath string , opts CreateRepoOptions ) error {
55+ func prepareRepoCommit (ctx context.Context , repo * repo_model.Repository , tmpDir string , opts CreateRepoOptions ) error {
5656 commitTimeStr := time .Now ().Format (time .RFC3339 )
5757 authorSig := repo .Owner .NewGitSig ()
5858
@@ -67,7 +67,7 @@ func prepareRepoCommit(ctx context.Context, repo *repo_model.Repository, tmpDir,
6767 )
6868
6969 // Clone to temporary path and do the init commit.
70- if stdout , _ , err := git .NewCommand ("clone" ).AddDynamicArguments (repoPath , tmpDir ).
70+ if stdout , _ , err := git .NewCommand ("clone" ).AddDynamicArguments (repo . RepoPath () , tmpDir ).
7171 RunStdString (ctx , & git.RunOpts {Dir : "" , Env : env }); err != nil {
7272 log .Error ("Failed to clone from %v into %s: stdout: %s\n Error: %v" , repo , tmpDir , stdout , err )
7373 return fmt .Errorf ("git clone: %w" , err )
@@ -139,7 +139,7 @@ func prepareRepoCommit(ctx context.Context, repo *repo_model.Repository, tmpDir,
139139}
140140
141141// InitRepository initializes README and .gitignore if needed.
142- func initRepository (ctx context.Context , repoPath string , u * user_model.User , repo * repo_model.Repository , opts CreateRepoOptions ) (err error ) {
142+ func initRepository (ctx context.Context , u * user_model.User , repo * repo_model.Repository , opts CreateRepoOptions ) (err error ) {
143143 if err = repo_module .CheckInitRepository (ctx , repo ); err != nil {
144144 return err
145145 }
@@ -156,7 +156,7 @@ func initRepository(ctx context.Context, repoPath string, u *user_model.User, re
156156 }
157157 }()
158158
159- if err = prepareRepoCommit (ctx , repo , tmpDir , repoPath , opts ); err != nil {
159+ if err = prepareRepoCommit (ctx , repo , tmpDir , opts ); err != nil {
160160 return fmt .Errorf ("prepareRepoCommit: %w" , err )
161161 }
162162
@@ -276,7 +276,7 @@ func CreateRepositoryDirectly(ctx context.Context, doer, u *user_model.User, opt
276276 }
277277 }
278278
279- if err = initRepository (ctx , repo . RepoPath (), doer , repo , opts ); err != nil {
279+ if err = initRepository (ctx , doer , repo , opts ); err != nil {
280280 if err2 := util .RemoveAll (repo .RepoPath ()); err2 != nil {
281281 log .Error ("initRepository: %v" , err )
282282 return fmt .Errorf (
0 commit comments