aboutsummaryrefslogtreecommitdiff
path: root/models/mirror.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2018-05-27 09:07:15 +0800
committerUnknwon <u@gogs.io>2018-05-27 09:07:15 +0800
commite33d9e77f43e6829ea967e47964d13f5a8aec5cc (patch)
treeace1a09414a66fd7e293b3837865633168ba4f6e /models/mirror.go
parentaff42082441715559bb2e62e11550af1a946a8c9 (diff)
vendor: rename "gogits" to "gogs"
Diffstat (limited to 'models/mirror.go')
-rw-r--r--models/mirror.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/models/mirror.go b/models/mirror.go
index 76427fae..b204a682 100644
--- a/models/mirror.go
+++ b/models/mirror.go
@@ -320,6 +320,15 @@ func SyncMirrors() {
continue
}
+ // TODO: Work on #2017 and #4528 together
+ // 1. Get commits after last update time
+ // 2. Simulate push event for new commits, see models/repo_editor.go:164
+ // This automatically triggers the "push" webhook
+
+ // ******************************
+ // EDIT AREA - START
+ // ******************************
+
// Get latest commit date and compare to current repository updated time,
// update if latest commit date is newer.
commitDate, err := git.GetLatestCommitDate(m.Repo.RepoPath(), "")
@@ -330,6 +339,10 @@ func SyncMirrors() {
continue
}
+ // ******************************
+ // EDIT AREA - END
+ // ******************************
+
if _, err = x.Exec("UPDATE repository SET updated_unix = ? WHERE id = ?", commitDate.Unix(), m.RepoID); err != nil {
log.Error(2, "Update repository 'updated_unix' [%s]: %v", m.RepoID, err)
continue