summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2020-12-12 11:20:14 +0000
committerGitHub <noreply@github.com>2020-12-12 12:20:14 +0100
commitf9c0737a861050182aa1445146da003f1d8ec0ae (patch)
tree7502d8c352ee2849e7ad76965bebd0da32133460 /services
parent1837e647eb2ae3f4de0ed1a729f0da01c07b9449 (diff)
downloadgitea-f9c0737a861050182aa1445146da003f1d8ec0ae.tar.gz
gitea-f9c0737a861050182aa1445146da003f1d8ec0ae.zip
Enforce setting HEAD in wiki to master (#13950)
The default branch in wikis must be master - therefore forcibly set the HEAD to master. Fix #13846 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
Diffstat (limited to 'services')
-rw-r--r--services/wiki/wiki.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/services/wiki/wiki.go b/services/wiki/wiki.go
index 5f7d26a045..67ba1abd0f 100644
--- a/services/wiki/wiki.go
+++ b/services/wiki/wiki.go
@@ -77,6 +77,8 @@ func InitWiki(repo *models.Repository) error {
return fmt.Errorf("InitRepository: %v", err)
} else if err = repo_module.CreateDelegateHooks(repo.WikiPath()); err != nil {
return fmt.Errorf("createDelegateHooks: %v", err)
+ } else if _, err = git.NewCommand("symbolic-ref", "HEAD", git.BranchPrefix+"master").RunInDir(repo.WikiPath()); err != nil {
+ return fmt.Errorf("unable to set default wiki branch to master: %v", err)
}
return nil
}