Skip to content

Commit ca46913

Browse files
committed
Removed Duplicate UpdateMirror Function
1 parent ac65d00 commit ca46913

File tree

3 files changed

+12
-23
lines changed

3 files changed

+12
-23
lines changed

models/repo.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -651,12 +651,6 @@ func (repo *Repository) GetMirror() (err error) {
651651
return err
652652
}
653653

654-
// UpdateMirror updates the repository mirror, returns an error upon failure
655-
func (repo *Repository) UpdateMirror(m *Mirror) (err error) {
656-
err = UpdateMirror(m)
657-
return err
658-
}
659-
660654
// GetBaseRepo populates repo.BaseRepo for a fork repository and
661655
// returns an error on failure (NOTE: no error is returned for
662656
// non-fork repositories, and BaseRepo will be left untouched)

routers/api/v1/repo/repo.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -243,17 +243,17 @@ func CreateUserRepo(ctx *context.APIContext, owner *models.User, opt api.CreateR
243243
opt.Readme = "Default"
244244
}
245245
repo, err := repo_service.CreateRepository(ctx.User, owner, models.CreateRepoOptions{
246-
Name: opt.Name,
247-
Description: opt.Description,
248-
IssueLabels: opt.IssueLabels,
249-
Gitignores: opt.Gitignores,
250-
License: opt.License,
251-
Readme: opt.Readme,
252-
IsPrivate: opt.Private,
253-
AutoInit: opt.AutoInit,
254-
DefaultBranch: opt.DefaultBranch,
255-
TrustModel: models.ToTrustModel(opt.TrustModel),
256-
IsTemplate: opt.Template,
246+
Name: opt.Name,
247+
Description: opt.Description,
248+
IssueLabels: opt.IssueLabels,
249+
Gitignores: opt.Gitignores,
250+
License: opt.License,
251+
Readme: opt.Readme,
252+
IsPrivate: opt.Private,
253+
AutoInit: opt.AutoInit,
254+
DefaultBranch: opt.DefaultBranch,
255+
TrustModel: models.ToTrustModel(opt.TrustModel),
256+
IsTemplate: opt.Template,
257257
})
258258
if err != nil {
259259
if models.IsErrRepoAlreadyExist(err) {
@@ -800,7 +800,7 @@ func updateMirrorInterval(ctx *context.APIContext, opts api.EditRepoOption) erro
800800
}
801801
if interval, err := time.ParseDuration(*opts.MirrorInterval); err == nil {
802802
repo.Mirror.Interval = interval
803-
if err := repo.UpdateMirror(repo.Mirror); err != nil {
803+
if err := models.UpdateMirror(repo.Mirror); err != nil {
804804
log.Error("Failed to Set Mirror Interval: %s", err)
805805
ctx.Error(http.StatusInternalServerError, "MirrorInterval", err)
806806
return err

templates/swagger/v1_json.tmpl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12491,11 +12491,6 @@
1249112491
"type": "string",
1249212492
"x-go-name": "License"
1249312493
},
12494-
"mirror_interval": {
12495-
"description": "MirrorInterval time when creating a mirror (used with mirrors)",
12496-
"type": "string",
12497-
"x-go-name": "MirrorInterval"
12498-
},
1249912494
"name": {
1250012495
"description": "Name of the repository to create",
1250112496
"type": "string",

0 commit comments

Comments
 (0)