summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-04-12 22:30:00 -0400
committerUnknown <joe2010xtmf@163.com>2014-04-12 22:30:00 -0400
commitc9a1eb4789d5142090d4936e19ac36b6c2010bd3 (patch)
treef1a6494a26522f85f67690ba176e2e48ef98b9d4 /modules
parent52b4ab2aa589cf892b24e95872cbac7b6e78ed3a (diff)
downloadgitea-c9a1eb4789d5142090d4936e19ac36b6c2010bd3.tar.gz
gitea-c9a1eb4789d5142090d4936e19ac36b6c2010bd3.zip
Able to change mirror interval now
Diffstat (limited to 'modules')
-rw-r--r--modules/middleware/context.go1
-rw-r--r--modules/middleware/repo.go10
2 files changed, 10 insertions, 1 deletions
diff --git a/modules/middleware/context.go b/modules/middleware/context.go
index edbf1f3ce8..f353ea51bd 100644
--- a/modules/middleware/context.go
+++ b/modules/middleware/context.go
@@ -62,6 +62,7 @@ type Context struct {
HTTPS string
Git string
}
+ *models.Mirror
}
}
diff --git a/modules/middleware/repo.go b/modules/middleware/repo.go
index f0a46b6dad..c8e1aaee72 100644
--- a/modules/middleware/repo.go
+++ b/modules/middleware/repo.go
@@ -102,9 +102,17 @@ func RepoAssignment(redirect bool, args ...bool) martini.Handler {
ctx.Repo.HasAccess = true
ctx.Data["HasAccess"] = true
+ if repo.IsMirror {
+ ctx.Repo.Mirror, err = models.GetMirror(repo.Id)
+ if err != nil {
+ ctx.Handle(500, "RepoAssignment(GetMirror)", err)
+ return
+ }
+ ctx.Data["MirrorInterval"] = ctx.Repo.Mirror.Interval
+ }
+
repo.NumOpenIssues = repo.NumIssues - repo.NumClosedIssues
ctx.Repo.Repository = repo
-
ctx.Data["IsBareRepo"] = ctx.Repo.Repository.IsBare
gitRepo, err := git.OpenRepository(models.RepoPath(userName, repoName))