summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-03-22 11:59:14 -0400
committerUnknown <joe2010xtmf@163.com>2014-03-22 11:59:14 -0400
commite3f55ca0fb0c8aee84f2935b76353ef8ce66384f (patch)
tree1fe38841e4a8a6dc63fc7700d8933b8730c63690 /models
parentcd070b56d2f5b34236174ff04ccc459d15c4cd17 (diff)
downloadgitea-e3f55ca0fb0c8aee84f2935b76353ef8ce66384f.tar.gz
gitea-e3f55ca0fb0c8aee84f2935b76353ef8ce66384f.zip
Need a field to specify if repository is bare
Diffstat (limited to 'models')
-rw-r--r--models/action.go1
-rw-r--r--models/repo.go6
2 files changed, 5 insertions, 2 deletions
diff --git a/models/action.go b/models/action.go
index 12122ae240..4e1107f891 100644
--- a/models/action.go
+++ b/models/action.go
@@ -87,6 +87,7 @@ func CommitRepoAction(userId int64, userName string,
if err != nil {
return err
}
+ repo.IsBare = false
repo.Updated = time.Now()
if err = UpdateRepository(repo); err != nil {
return err
diff --git a/models/repo.go b/models/repo.go
index 1961b31e94..fb115de590 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -83,10 +83,11 @@ type Repository struct {
Name string `xorm:"index not null"`
Description string
Website string
- Private bool
NumWatches int
NumStars int
NumForks int
+ IsPrivate bool
+ IsBare bool
Created time.Time `xorm:"created"`
Updated time.Time `xorm:"updated"`
}
@@ -139,7 +140,8 @@ func CreateRepository(user *User, repoName, desc, repoLang, license string, priv
Name: repoName,
LowerName: strings.ToLower(repoName),
Description: desc,
- Private: private,
+ IsPrivate: private,
+ IsBare: repoLang == "" && license == "" && !initReadme,
}
repoPath := RepoPath(user.Name, repoName)