Skip to content

Commit bbd4648

Browse files
committed
Add sync items to Mirror struct
1 parent 4f67c5d commit bbd4648

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

models/repo/mirror.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ type Mirror struct {
2727
Interval time.Duration
2828
EnablePrune bool `xorm:"NOT NULL DEFAULT true"`
2929

30+
SyncWiki bool
31+
SyncIssues bool
32+
SyncMilestones bool
33+
SyncLabels bool
34+
SyncReleases bool
35+
SyncComments bool
36+
SyncPullRequests bool
37+
3038
UpdatedUnix timeutil.TimeStamp `xorm:"INDEX"`
3139
NextUpdateUnix timeutil.TimeStamp `xorm:"INDEX"`
3240

modules/repository/repo.go

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,18 @@ func MigrateRepositoryGitData(ctx context.Context, u *user_model.User,
177177

178178
if opts.Mirror {
179179
mirrorModel := repo_model.Mirror{
180-
RepoID: repo.ID,
181-
Interval: setting.Mirror.DefaultInterval,
182-
EnablePrune: true,
183-
NextUpdateUnix: timeutil.TimeStampNow().AddDuration(setting.Mirror.DefaultInterval),
184-
LFS: opts.LFS,
180+
RepoID: repo.ID,
181+
Interval: setting.Mirror.DefaultInterval,
182+
SyncWiki: opts.Wiki,
183+
SyncIssues: opts.Issues,
184+
SyncMilestones: opts.Milestones,
185+
SyncLabels: opts.Labels,
186+
SyncReleases: opts.Releases,
187+
SyncComments: opts.Comments,
188+
SyncPullRequests: opts.PullRequests,
189+
EnablePrune: true,
190+
NextUpdateUnix: timeutil.TimeStampNow().AddDuration(setting.Mirror.DefaultInterval),
191+
LFS: opts.LFS,
185192
}
186193
if opts.LFS {
187194
mirrorModel.LFSEndpoint = opts.LFSEndpoint

0 commit comments

Comments
 (0)