@@ -74,17 +74,18 @@ func InitGitServices() {
74
74
guaranteeInit (repository .NewContext )
75
75
}
76
76
77
- func syncAppPathForGitHooks (ctx context.Context ) (err error ) {
77
+ func syncAppPathForGit (ctx context.Context ) (err error ) {
78
78
runtimeState := new (appstate.RuntimeState )
79
79
if err = setting .AppState .Get (runtimeState ); err != nil {
80
80
return err
81
81
}
82
82
if runtimeState .LastAppPath != setting .AppPath {
83
83
log .Info ("AppPath changed from '%s' to '%s', sync repository hooks ..." , runtimeState .LastAppPath , setting .AppPath )
84
- err = repo_module .SyncRepositoryHooks (ctx )
85
- if err != nil {
86
- return err
87
- }
84
+ guaranteeInitCtx (ctx , repo_module .SyncRepositoryHooks )
85
+
86
+ log .Info ("AppPath changed from '%s' to '%s', sync ssh keys ..." , runtimeState .LastAppPath , setting .AppPath )
87
+ guaranteeInit (models .RewriteAllPublicKeys )
88
+
88
89
runtimeState .LastAppPath = setting .AppPath
89
90
return setting .AppState .Set (runtimeState )
90
91
}
@@ -148,7 +149,7 @@ func GlobalInit(ctx context.Context) {
148
149
guaranteeInit (repo_migrations .Init )
149
150
eventsource .GetManager ().Init ()
150
151
151
- guaranteeInitCtx (ctx , syncAppPathForGitHooks )
152
+ guaranteeInitCtx (ctx , syncAppPathForGit )
152
153
153
154
if setting .SSH .StartBuiltinServer {
154
155
ssh .Listen (setting .SSH .ListenHost , setting .SSH .ListenPort , setting .SSH .ServerCiphers , setting .SSH .ServerKeyExchanges , setting .SSH .ServerMACs )
0 commit comments