File tree 1 file changed +9
-4
lines changed
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -251,12 +251,17 @@ func syncGitConfig() (err error) {
251
251
}
252
252
}
253
253
254
- //
255
254
// Disable the security check because Gitea runs the git CLI from within the
256
255
// repository. See https://github.com/go-gitea/gitea/issues/19455 for the full discussion.
257
- //
258
- if err := configAddNonExist ("safe.directory" , "*" ); err != nil {
259
- return err
256
+ // safe.directory accept * was introduced in https://github.com/git/git/blob/main/Documentation/RelNotes/2.30.4.txt
257
+ if CheckGitVersionAtLeast ("2.30.4" ) == nil {
258
+ if err := configAddNonExist ("safe.directory" , "*" ); err != nil {
259
+ return err
260
+ }
261
+ } else {
262
+ if err := configSet ("safe.directory" , setting .RepoRootPath ); err != nil {
263
+ return err
264
+ }
260
265
}
261
266
262
267
if runtime .GOOS == "windows" {
You can’t perform that action at this time.
0 commit comments