Skip to content

Commit

Permalink
Remove LocalWikiPath
Browse files Browse the repository at this point in the history
  • Loading branch information
zeripath committed Apr 18, 2019
1 parent d378539 commit 6e26309
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 20 deletions.
1 change: 0 additions & 1 deletion contrib/pr/checkout.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ func runPR() {
models.LoadFixtures()
os.RemoveAll(setting.RepoRootPath)
os.RemoveAll(models.LocalCopyPath())
os.RemoveAll(models.LocalWikiPath())
com.CopyDir(path.Join(curDir, "integrations/gitea-repositories-meta"), setting.RepoRootPath)

log.Printf("[PR] Setting up router\n")
Expand Down
1 change: 0 additions & 1 deletion integrations/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ func prepareTestEnv(t testing.TB, skip ...int) {
assert.NoError(t, models.LoadFixtures())
assert.NoError(t, os.RemoveAll(setting.RepoRootPath))
assert.NoError(t, os.RemoveAll(models.LocalCopyPath()))
assert.NoError(t, os.RemoveAll(models.LocalWikiPath()))

assert.NoError(t, com.CopyDir(path.Join(filepath.Dir(setting.AppPath), "integrations/gitea-repositories-meta"),
setting.RepoRootPath))
Expand Down
1 change: 1 addition & 0 deletions models/helper_directory.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (

"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"

"github.com/Unknwon/com"
)

Expand Down
15 changes: 0 additions & 15 deletions models/wiki.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@ import (
"fmt"
"net/url"
"os"
"path"
"path/filepath"
"strings"

"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/sync"

"github.com/Unknwon/com"
Expand Down Expand Up @@ -89,19 +87,6 @@ func (repo *Repository) InitWiki() error {
return nil
}

// LocalWikiPath returns the local wiki repository copy path.
func LocalWikiPath() string {
if filepath.IsAbs(setting.Repository.Local.LocalWikiPath) {
return setting.Repository.Local.LocalWikiPath
}
return path.Join(setting.AppDataPath, setting.Repository.Local.LocalWikiPath)
}

// LocalWikiPath returns the path to the local wiki repository (?).
func (repo *Repository) LocalWikiPath() string {
return path.Join(LocalWikiPath(), com.ToStr(repo.ID))
}

// nameAllowed checks if a wiki name is allowed
func nameAllowed(name string) error {
for _, reservedName := range reservedWikiNames {
Expand Down
3 changes: 0 additions & 3 deletions modules/setting/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ var (
// Repository local settings
Local struct {
LocalCopyPath string
LocalWikiPath string
} `ini:"-"`

// Pull request settings
Expand Down Expand Up @@ -105,10 +104,8 @@ var (
// Repository local settings
Local: struct {
LocalCopyPath string
LocalWikiPath string
}{
LocalCopyPath: "tmp/local-repo",
LocalWikiPath: "tmp/local-wiki",
},

// Pull request settings
Expand Down

0 comments on commit 6e26309

Please sign in to comment.