summaryrefslogtreecommitdiffstats
path: root/routers/repo
diff options
context:
space:
mode:
Diffstat (limited to 'routers/repo')
-rw-r--r--routers/repo/repo.go6
-rw-r--r--routers/repo/setting.go7
2 files changed, 9 insertions, 4 deletions
diff --git a/routers/repo/repo.go b/routers/repo/repo.go
index f930c132d2..7cc7df35a2 100644
--- a/routers/repo/repo.go
+++ b/routers/repo/repo.go
@@ -192,7 +192,7 @@ func MigratePost(ctx *middleware.Context, form auth.MigrateRepoForm) {
RemoteAddr: remoteAddr,
})
if err == nil {
- log.Trace("Repository migrated[%d]: %s/%s", repo.ID, ctxUser.Name, form.RepoName)
+ log.Trace("Repository migrated [%d]: %s/%s", repo.ID, ctxUser.Name, form.RepoName)
ctx.Redirect(setting.AppSubUrl + "/" + ctxUser.Name + "/" + form.RepoName)
return
}
@@ -206,11 +206,11 @@ func MigratePost(ctx *middleware.Context, form auth.MigrateRepoForm) {
if strings.Contains(err.Error(), "Authentication failed") ||
strings.Contains(err.Error(), "could not read Username") {
ctx.Data["Err_Auth"] = true
- ctx.RenderWithErr(ctx.Tr("form.auth_failed", strings.Replace(err.Error(), ":"+form.AuthPassword+"@", ":<password>@", 1)), MIGRATE, &form)
+ ctx.RenderWithErr(ctx.Tr("form.auth_failed", models.HandleCloneUserCredentials(err.Error(), true)), MIGRATE, &form)
return
} else if strings.Contains(err.Error(), "fatal:") {
ctx.Data["Err_CloneAddr"] = true
- ctx.RenderWithErr(ctx.Tr("repo.migrate.failed", strings.Replace(err.Error(), ":"+form.AuthPassword+"@", ":<password>@", 1)), MIGRATE, &form)
+ ctx.RenderWithErr(ctx.Tr("repo.migrate.failed", models.HandleCloneUserCredentials(err.Error(), true)), MIGRATE, &form)
return
}
diff --git a/routers/repo/setting.go b/routers/repo/setting.go
index beda715c18..e4c4f897a0 100644
--- a/routers/repo/setting.go
+++ b/routers/repo/setting.go
@@ -109,9 +109,14 @@ func SettingsPost(ctx *middleware.Context, form auth.RepoSettingForm) {
ctx.Repo.Mirror.Interval = form.Interval
ctx.Repo.Mirror.NextUpdate = time.Now().Add(time.Duration(form.Interval) * time.Hour)
if err := models.UpdateMirror(ctx.Repo.Mirror); err != nil {
- log.Error(4, "UpdateMirror: %v", err)
+ ctx.Handle(500, "UpdateMirror", err)
+ return
}
}
+ if err := ctx.Repo.Mirror.SaveAddress(form.MirrorAddress); err != nil {
+ ctx.Handle(500, "SaveAddress", err)
+ return
+ }
}
ctx.Flash.Success(ctx.Tr("repo.settings.update_settings_success"))