aboutsummaryrefslogtreecommitdiff
path: root/models/repo.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/repo.go')
-rw-r--r--models/repo.go46
1 files changed, 23 insertions, 23 deletions
diff --git a/models/repo.go b/models/repo.go
index 827c9aaf..909af1d8 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -23,15 +23,15 @@ import (
log "gopkg.in/clog.v1"
"gopkg.in/ini.v1"
- git "github.com/gogits/git-module"
- api "github.com/gogits/go-gogs-client"
-
- "github.com/gogits/gogs/models/errors"
- "github.com/gogits/gogs/pkg/bindata"
- "github.com/gogits/gogs/pkg/markup"
- "github.com/gogits/gogs/pkg/process"
- "github.com/gogits/gogs/pkg/setting"
- "github.com/gogits/gogs/pkg/sync"
+ git "github.com/gogs/git-module"
+ api "github.com/gogs/go-gogs-client"
+
+ "github.com/gogs/gogs/models/errors"
+ "github.com/gogs/gogs/pkg/bindata"
+ "github.com/gogs/gogs/pkg/markup"
+ "github.com/gogs/gogs/pkg/process"
+ "github.com/gogs/gogs/pkg/setting"
+ "github.com/gogs/gogs/pkg/sync"
)
var repoWorkingPool = sync.NewExclusivePool()
@@ -143,10 +143,10 @@ func NewRepoContext() {
type Repository struct {
ID int64
OwnerID int64 `xorm:"UNIQUE(s)"`
- Owner *User `xorm:"-"`
+ Owner *User `xorm:"-" json:"-"`
LowerName string `xorm:"UNIQUE(s) INDEX NOT NULL"`
Name string `xorm:"INDEX NOT NULL"`
- Description string
+ Description string `xorm:"VARCHAR(512)"`
Website string
DefaultBranch string
Size int64 `xorm:"NOT NULL DEFAULT 0"`
@@ -156,20 +156,20 @@ type Repository struct {
NumForks int
NumIssues int
NumClosedIssues int
- NumOpenIssues int `xorm:"-"`
+ NumOpenIssues int `xorm:"-" json:"-"`
NumPulls int
NumClosedPulls int
- NumOpenPulls int `xorm:"-"`
+ NumOpenPulls int `xorm:"-" json:"-"`
NumMilestones int `xorm:"NOT NULL DEFAULT 0"`
NumClosedMilestones int `xorm:"NOT NULL DEFAULT 0"`
- NumOpenMilestones int `xorm:"-"`
- NumTags int `xorm:"-"`
+ NumOpenMilestones int `xorm:"-" json:"-"`
+ NumTags int `xorm:"-" json:"-"`
IsPrivate bool
IsBare bool
IsMirror bool
- *Mirror `xorm:"-"`
+ *Mirror `xorm:"-" json:"-"`
// Advanced settings
EnableWiki bool `xorm:"NOT NULL DEFAULT true"`
@@ -182,18 +182,18 @@ type Repository struct {
ExternalTrackerURL string
ExternalTrackerFormat string
ExternalTrackerStyle string
- ExternalMetas map[string]string `xorm:"-"`
+ ExternalMetas map[string]string `xorm:"-" json:"-"`
EnablePulls bool `xorm:"NOT NULL DEFAULT true"`
PullsIgnoreWhitespace bool `xorm:"NOT NULL DEFAULT false"`
PullsAllowRebase bool `xorm:"NOT NULL DEFAULT false"`
IsFork bool `xorm:"NOT NULL DEFAULT false"`
ForkID int64
- BaseRepo *Repository `xorm:"-"`
+ BaseRepo *Repository `xorm:"-" json:"-"`
- Created time.Time `xorm:"-"`
+ Created time.Time `xorm:"-" json:"-"`
CreatedUnix int64
- Updated time.Time `xorm:"-"`
+ Updated time.Time `xorm:"-" json:"-"`
UpdatedUnix int64
}
@@ -750,7 +750,7 @@ func MigrateRepository(doer, owner *User, opts MigrateRepoOptions) (*Repository,
RepoID: repo.ID,
Interval: setting.Mirror.DefaultInterval,
EnablePrune: true,
- NextUpdate: time.Now().Add(time.Duration(setting.Mirror.DefaultInterval) * time.Hour),
+ NextSync: time.Now().Add(time.Duration(setting.Mirror.DefaultInterval) * time.Hour),
}); err != nil {
return repo, fmt.Errorf("InsertOne: %v", err)
}
@@ -1331,8 +1331,8 @@ func GetRepositoriesByForkID(forkID int64) ([]*Repository, error) {
func updateRepository(e Engine, repo *Repository, visibilityChanged bool) (err error) {
repo.LowerName = strings.ToLower(repo.Name)
- if len(repo.Description) > 255 {
- repo.Description = repo.Description[:255]
+ if len(repo.Description) > 512 {
+ repo.Description = repo.Description[:512]
}
if len(repo.Website) > 255 {
repo.Website = repo.Website[:255]