aboutsummaryrefslogtreecommitdiff
path: root/internal/cmd
diff options
context:
space:
mode:
authorᴜɴᴋɴᴡᴏɴ <u@gogs.io>2020-02-22 15:22:32 +0800
committerGitHub <noreply@github.com>2020-02-22 15:22:32 +0800
commitc4a0a404735cdcfdcb805e9fed474c75110bca89 (patch)
treed4ef0af7722425451f23b6ca06ef90a375a5f6bc /internal/cmd
parentf59a68c531c680d4488d8d977798f6aa36551bfa (diff)
conf: overhaul repository settings (#5932)
Diffstat (limited to 'internal/cmd')
-rw-r--r--internal/cmd/backup.go4
-rw-r--r--internal/cmd/restore.go2
-rw-r--r--internal/cmd/serv.go2
3 files changed, 4 insertions, 4 deletions
diff --git a/internal/cmd/backup.go b/internal/cmd/backup.go
index 28411b0e..035b68af 100644
--- a/internal/cmd/backup.go
+++ b/internal/cmd/backup.go
@@ -119,8 +119,8 @@ func runBackup(c *cli.Context) error {
// Repositories
if !c.Bool("exclude-repos") && !c.Bool("database-only") {
reposDump := filepath.Join(rootDir, "repositories.zip")
- log.Info("Dumping repositories in '%s'", conf.RepoRootPath)
- if err = zip.PackTo(conf.RepoRootPath, reposDump, true); err != nil {
+ log.Info("Dumping repositories in %q", conf.Repository.Root)
+ if err = zip.PackTo(conf.Repository.Root, reposDump, true); err != nil {
log.Fatal("Failed to dump repositories: %v", err)
}
log.Info("Repositories dumped to: %s", reposDump)
diff --git a/internal/cmd/restore.go b/internal/cmd/restore.go
index fcb006cf..f1f2c99f 100644
--- a/internal/cmd/restore.go
+++ b/internal/cmd/restore.go
@@ -145,7 +145,7 @@ func runRestore(c *cli.Context) error {
// Repositories
reposPath := filepath.Join(archivePath, "repositories.zip")
if !c.Bool("exclude-repos") && !c.Bool("database-only") && com.IsExist(reposPath) {
- if err := zip.ExtractTo(reposPath, filepath.Dir(conf.RepoRootPath)); err != nil {
+ if err := zip.ExtractTo(reposPath, filepath.Dir(conf.Repository.Root)); err != nil {
log.Fatal("Failed to extract 'repositories.zip': %v", err)
}
}
diff --git a/internal/cmd/serv.go b/internal/cmd/serv.go
index 8d4a78ef..5076520c 100644
--- a/internal/cmd/serv.go
+++ b/internal/cmd/serv.go
@@ -267,7 +267,7 @@ func runServ(c *cli.Context) error {
RepoPath: repo.RepoPath(),
})...)
}
- gitCmd.Dir = conf.RepoRootPath
+ gitCmd.Dir = conf.Repository.Root
gitCmd.Stdout = os.Stdout
gitCmd.Stdin = os.Stdin
gitCmd.Stderr = os.Stderr