aboutsummaryrefslogtreecommitdiff
path: root/internal/db/repo_editor.go
diff options
context:
space:
mode:
authorᴜɴᴋɴᴡᴏɴ <u@gogs.io>2020-02-22 09:05:26 +0800
committerGitHub <noreply@github.com>2020-02-22 09:05:26 +0800
commit648d9e253c1924b832248f26fee42b2fb64dc3bc (patch)
tree51649fad974cd7284a47d30e412c90e7ab72cd2c /internal/db/repo_editor.go
parent5b14cc6f0b7b661beb2640a94bd15660cdb48587 (diff)
conf: overhaul server settings (#5928)
* conf: rename package * Requires Go 1.12 * Fix lint * Fix lint * Overhaul * db: fix tests * Save my work * Fix tests * Server.UnixSocketPermission * Server.LocalRootURL * SSH settings * Server.OfflineMode * Save my work * App.Version * Remove [server] STATIC_ROOT_PATH * Server.LandingURL
Diffstat (limited to 'internal/db/repo_editor.go')
-rw-r--r--internal/db/repo_editor.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/db/repo_editor.go b/internal/db/repo_editor.go
index ebd4be47..38fea3f4 100644
--- a/internal/db/repo_editor.go
+++ b/internal/db/repo_editor.go
@@ -24,7 +24,7 @@ import (
"gogs.io/gogs/internal/db/errors"
"gogs.io/gogs/internal/osutil"
"gogs.io/gogs/internal/process"
- "gogs.io/gogs/internal/setting"
+ "gogs.io/gogs/internal/conf"
"gogs.io/gogs/internal/tool"
)
@@ -95,7 +95,7 @@ func (repo *Repository) DiscardLocalRepoBranchChanges(branch string) error {
// checkoutNewBranch checks out to a new branch from the a branch name.
func checkoutNewBranch(repoPath, localPath, oldBranch, newBranch string) error {
if err := git.Checkout(localPath, git.CheckoutOptions{
- Timeout: time.Duration(setting.Git.Timeout.Pull) * time.Second,
+ Timeout: time.Duration(conf.Git.Timeout.Pull) * time.Second,
Branch: newBranch,
OldBranch: oldBranch,
}); err != nil {
@@ -231,7 +231,7 @@ func (repo *Repository) GetDiffPreview(branch, treePath, content string) (diff *
pid := process.Add(fmt.Sprintf("GetDiffPreview [repo_path: %s]", repo.RepoPath()), cmd)
defer process.Remove(pid)
- diff, err = ParsePatch(setting.Git.MaxGitDiffLines, setting.Git.MaxGitDiffLineCharacters, setting.Git.MaxGitDiffFiles, stdout)
+ diff, err = ParsePatch(conf.Git.MaxGitDiffLines, conf.Git.MaxGitDiffLineCharacters, conf.Git.MaxGitDiffFiles, stdout)
if err != nil {
return nil, fmt.Errorf("parse path: %v", err)
}
@@ -318,7 +318,7 @@ type Upload struct {
// UploadLocalPath returns where uploads is stored in local file system based on given UUID.
func UploadLocalPath(uuid string) string {
- return path.Join(setting.Repository.Upload.TempPath, uuid[0:1], uuid[1:2], uuid)
+ return path.Join(conf.Repository.Upload.TempPath, uuid[0:1], uuid[1:2], uuid)
}
// LocalPath returns where uploads are temporarily stored in local file system.