diff options
Diffstat (limited to 'modules/repository/init.go')
-rw-r--r-- | modules/repository/init.go | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/modules/repository/init.go b/modules/repository/init.go index d7f31fabde..cfee1a3215 100644 --- a/modules/repository/init.go +++ b/modules/repository/init.go @@ -14,6 +14,7 @@ import ( "time" "code.gitea.io/gitea/models" + repo_model "code.gitea.io/gitea/models/repo" user_model "code.gitea.io/gitea/models/user" "code.gitea.io/gitea/modules/git" "code.gitea.io/gitea/modules/log" @@ -23,7 +24,7 @@ import ( "github.com/unknwon/com" ) -func prepareRepoCommit(ctx context.Context, repo *models.Repository, tmpDir, repoPath string, opts models.CreateRepoOptions) error { +func prepareRepoCommit(ctx context.Context, repo *repo_model.Repository, tmpDir, repoPath string, opts models.CreateRepoOptions) error { commitTimeStr := time.Now().Format(time.RFC3339) authorSig := repo.Owner.NewGitSig() @@ -101,7 +102,7 @@ func prepareRepoCommit(ctx context.Context, repo *models.Repository, tmpDir, rep } // initRepoCommit temporarily changes with work directory. -func initRepoCommit(tmpPath string, repo *models.Repository, u *user_model.User, defaultBranch string) (err error) { +func initRepoCommit(tmpPath string, repo *repo_model.Repository, u *user_model.User, defaultBranch string) (err error) { commitTimeStr := time.Now().Format(time.RFC3339) sig := u.NewGitSig() @@ -137,7 +138,7 @@ func initRepoCommit(tmpPath string, repo *models.Repository, u *user_model.User, if sign { args = append(args, "-S"+keyID) - if repo.GetTrustModel() == models.CommitterTrustModel || repo.GetTrustModel() == models.CollaboratorCommitterTrustModel { + if repo.GetTrustModel() == repo_model.CommitterTrustModel || repo.GetTrustModel() == repo_model.CollaboratorCommitterTrustModel { // need to set the committer to the KeyID owner committerName = signer.Name committerEmail = signer.Email @@ -175,7 +176,7 @@ func initRepoCommit(tmpPath string, repo *models.Repository, u *user_model.User, func checkInitRepository(owner, name string) (err error) { // Somehow the directory could exist. - repoPath := models.RepoPath(owner, name) + repoPath := repo_model.RepoPath(owner, name) isExist, err := util.IsExist(repoPath) if err != nil { log.Error("Unable to check if %s exists. Error: %v", repoPath, err) @@ -198,7 +199,7 @@ func checkInitRepository(owner, name string) (err error) { } // InitRepository initializes README and .gitignore if needed. -func initRepository(ctx context.Context, repoPath string, u *user_model.User, repo *models.Repository, opts models.CreateRepoOptions) (err error) { +func initRepository(ctx context.Context, repoPath string, u *user_model.User, repo *repo_model.Repository, opts models.CreateRepoOptions) (err error) { if err = checkInitRepository(repo.OwnerName, repo.Name); err != nil { return err } @@ -227,7 +228,7 @@ func initRepository(ctx context.Context, repoPath string, u *user_model.User, re // Re-fetch the repository from database before updating it (else it would // override changes that were done earlier with sql) - if repo, err = models.GetRepositoryByIDCtx(ctx, repo.ID); err != nil { + if repo, err = repo_model.GetRepositoryByIDCtx(ctx, repo.ID); err != nil { return fmt.Errorf("getRepositoryByID: %v", err) } |