Skip to content

Commit 184dc9a

Browse files
authored
Update lfs.go
1 parent 02f9dd4 commit 184dc9a

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

modules/setting/lfs.go

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@ import (
1010
"code.gitea.io/gitea/modules/generate"
1111
)
1212

13-
const (
14-
LFSConfigSectionServer = "server"
15-
LFSConfigSectionClient = "lfs_client"
16-
)
17-
18-
// LFS represents the legacy configuration for Git LFS, to be migrated to LFSServer
13+
// LFS represents the server-side configuration for Git LFS.
14+
// Ideally these options should be in a section like "[lfs_server]",
15+
// but they are in "[server]" section due to historical reasons.
16+
// Could be refactored in the future while keeping backwards compatibility.
1917
var LFS = struct {
2018
StartServer bool `ini:"LFS_START_SERVER"`
2119
AllowPureSSH bool `ini:"LFS_ALLOW_PURE_SSH"`
@@ -28,16 +26,16 @@ var LFS = struct {
2826
Storage *Storage
2927
}{}
3028

31-
// LFSClient represents configuration for mirroring upstream Git LFS
29+
// LFSClient represents configuration for Gitea's LFS clients, for example: mirroring upstream Git LFS
3230
var LFSClient = struct {
3331
BatchSize int `ini:"BATCH_SIZE"`
3432
}{}
3533

3634
func loadLFSFrom(rootCfg ConfigProvider) error {
37-
mustMapSetting(rootCfg, LFSConfigSectionClient, &LFSClient)
38-
mustMapSetting(rootCfg, LFSConfigSectionServer, &LFS)
35+
mustMapSetting(rootCfg, "lfs_client", &LFSClient)
3936

40-
sec := rootCfg.Section(LFSConfigSectionServer)
37+
mustMapSetting(rootCfg, "server", &LFS)
38+
sec := rootCfg.Section("server")
4139

4240
lfsSec, _ := rootCfg.GetSection("lfs")
4341

0 commit comments

Comments
 (0)