Skip to content

Commit 60a8fd6

Browse files
committed
fix bug
1 parent 1184828 commit 60a8fd6

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

models/models.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import (
1616

1717
"code.gitea.io/gitea/modules/log"
1818
"code.gitea.io/gitea/modules/setting"
19-
"code.gitea.io/gitea/modules/util"
2019

2120
// Needed for the MySQL driver
2221
_ "github.com/go-sql-driver/mysql"
@@ -348,12 +347,3 @@ func DumpDatabase(filePath string, dbType string) error {
348347
}
349348
return x.DumpTablesToFile(tbs, filePath)
350349
}
351-
352-
// absolutePath make path absolute if it is relative
353-
func absolutePath(path string) string {
354-
workDir, err := setting.WorkDir()
355-
if err != nil {
356-
log.Fatal(4, "Failed to get work directory: %v", err)
357-
}
358-
return util.EnsureAbsolutePath(path, workDir)
359-
}

modules/setting/setting.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ func getAppPath() (string, error) {
532532
if IsWindows && filepath.IsAbs(os.Args[0]) {
533533
appPath = filepath.Clean(os.Args[0])
534534
} else {
535-
appPath, err := exec.LookPath(os.Args[0])
535+
appPath, err = exec.LookPath(os.Args[0])
536536
}
537537

538538
if err != nil {
@@ -785,7 +785,7 @@ func NewContext() {
785785
}
786786
LFS.ContentPath = sec.Key("LFS_CONTENT_PATH").MustString(filepath.Join(AppDataPath, "lfs"))
787787
if !filepath.IsAbs(LFS.ContentPath) {
788-
LFS.ContentPath = filepath.Join(workDir, LFS.ContentPath)
788+
LFS.ContentPath = filepath.Join(AppWorkPath, LFS.ContentPath)
789789
}
790790

791791
if LFS.StartServer {

0 commit comments

Comments
 (0)