aboutsummaryrefslogtreecommitdiffstats
path: root/services/repository/files/temp_repo.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/repository/files/temp_repo.go')
-rw-r--r--services/repository/files/temp_repo.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/services/repository/files/temp_repo.go b/services/repository/files/temp_repo.go
index 55dcd7436c..815aa2c69f 100644
--- a/services/repository/files/temp_repo.go
+++ b/services/repository/files/temp_repo.go
@@ -15,6 +15,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"
@@ -24,13 +25,13 @@ import (
// TemporaryUploadRepository is a type to wrap our upload repositories as a shallow clone
type TemporaryUploadRepository struct {
- repo *models.Repository
+ repo *repo_model.Repository
gitRepo *git.Repository
basePath string
}
// NewTemporaryUploadRepository creates a new temporary upload repository
-func NewTemporaryUploadRepository(repo *models.Repository) (*TemporaryUploadRepository, error) {
+func NewTemporaryUploadRepository(repo *repo_model.Repository) (*TemporaryUploadRepository, error) {
basePath, err := models.CreateTemporaryPath("upload")
if err != nil {
return nil, err
@@ -56,7 +57,7 @@ func (t *TemporaryUploadRepository) Clone(branch string) error {
Name: branch,
}
} else if matched, _ := regexp.MatchString(".* repository .* does not exist.*", stderr); matched {
- return models.ErrRepoNotExist{
+ return repo_model.ErrRepoNotExist{
ID: t.repo.ID,
UID: t.repo.OwnerID,
OwnerName: t.repo.OwnerName,
@@ -216,10 +217,10 @@ func (t *TemporaryUploadRepository) CommitTreeWithDate(author, committer *user_m
// Determine if we should sign
if git.CheckGitVersionAtLeast("1.7.9") == nil {
- sign, keyID, signer, _ := t.repo.SignCRUDAction(author, t.basePath, "HEAD")
+ sign, keyID, signer, _ := models.SignCRUDAction(t.repo, author, t.basePath, "HEAD")
if sign {
args = append(args, "-S"+keyID)
- if t.repo.GetTrustModel() == models.CommitterTrustModel || t.repo.GetTrustModel() == models.CollaboratorCommitterTrustModel {
+ if t.repo.GetTrustModel() == repo_model.CommitterTrustModel || t.repo.GetTrustModel() == repo_model.CollaboratorCommitterTrustModel {
if committerSig.Name != authorSig.Name || committerSig.Email != authorSig.Email {
// Add trailers
_, _ = messageBytes.WriteString("\n")