Skip to content

Commit d4c9399

Browse files
cez81lafriks
authored andcommitted
Set default lfs content path (#2521)
1 parent 2222448 commit d4c9399

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

modules/setting/setting.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,9 +740,14 @@ func NewContext() {
740740
SSH.AuthorizedKeysBackup = sec.Key("SSH_AUTHORIZED_KEYS_BACKUP").MustBool(true)
741741
SSH.ExposeAnonymous = sec.Key("SSH_EXPOSE_ANONYMOUS").MustBool(false)
742742

743-
if err = Cfg.Section("server").MapTo(&LFS); err != nil {
743+
sec = Cfg.Section("server")
744+
if err = sec.MapTo(&LFS); err != nil {
744745
log.Fatal(4, "Failed to map LFS settings: %v", err)
745746
}
747+
LFS.ContentPath = sec.Key("LFS_CONTENT_PATH").MustString(filepath.Join(AppDataPath, "lfs"))
748+
if !filepath.IsAbs(LFS.ContentPath) {
749+
LFS.ContentPath = filepath.Join(workDir, LFS.ContentPath)
750+
}
746751

747752
if LFS.StartServer {
748753

0 commit comments

Comments
 (0)