forgejo/modules
Gergely Nagy 2ca4862f8b
[GITEA] Allow changing the repo Wiki branch to main
Previously, the repo wiki was hardcoded to use `master` as its branch,
this change makes it possible to use `main` (or something else, governed
by `[repository].DEFAULT_BRANCH`, a setting that already exists and
defaults to `main`).

The way it is done is that a new column is added to the `repository`
table: `wiki_branch`. The migration will make existing repositories
default to `master`, for compatibility's sake, even if they don't have a
Wiki (because it's easier to do that). Newly created repositories will
default to `[repository].DEFAULT_BRANCH` instead.

The Wiki service was updated to use the branch name stored in the
database, and fall back to the default if it is empty.

Old repositories with Wikis using the older `master` branch will have
the option to do a one-time transition to `main`, available via the
repository settings in the "Danger Zone". This option will only be
available for repositories that have the internal wiki enabled, it is
not empty, and the wiki branch is not `[repository].DEFAULT_BRANCH`.

When migrating a repository with a Wiki, Forgejo will use the same
branch name for the wiki as the source repository did. If that's not the
same as the default, the option to normalize it will be available after
the migration's done.

Additionally, the `/api/v1/{owner}/{repo}` endpoint was updated: it will
now include the wiki branch name in `GET` requests, and allow changing
the wiki branch via `PATCH`.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit d87c526d2a313fa45093ab49b78bb30322b33298)
2024-02-05 16:57:47 +01:00
..
actions [ACTIONS] on.schedule: the event is always "schedule" 2024-02-05 16:54:44 +01:00
activitypub
analyze
assetfs
auth [GITEA] Drop sha256-simd in favor of stdlib 2024-02-05 16:09:40 +01:00
avatar [GITEA] Drop sha256-simd in favor of stdlib 2024-02-05 16:09:40 +01:00
base [GITEA] Drop sha256-simd in favor of stdlib 2024-02-05 16:09:40 +01:00
cache
charset Preserve BOM in web editor (#28935) 2024-01-27 18:02:51 +00:00
container
context [GITEA] Allow changing the repo Wiki branch to main 2024-02-05 16:57:47 +01:00
contexttest Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
csv
emoji
eventsource Final round of db.DefaultContext refactor (#27587) 2023-10-14 08:37:24 +00:00
generate [GITEA] Refactor generation of JWT secret 2024-02-05 16:54:44 +01:00
git [GITEA] Improved Linguist compatibility 2024-02-05 16:09:43 +01:00
gitgraph
gitrepo Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
graceful Suggest to use Type=simple for systemd service (#28717) 2024-01-07 15:18:04 +00:00
hcaptcha
highlight
hostmatcher
html
httpcache Also match weakly validated ETags (#28957) 2024-01-29 16:18:40 +00:00
httplib
indexer [GITEA] Vendor rupture dependency 2024-02-05 15:08:04 +01:00
issue/template
json
label
lfs [GITEA] Drop sha256-simd in favor of stdlib 2024-02-05 16:09:40 +01:00
log Reduce some allocations in type conversion (#26772) 2023-08-29 00:43:16 +08:00
markup [GITEA] Add footnote testing 2024-02-05 16:09:41 +01:00
mcaptcha
metrics
migration
nosql
optional Unify user update methods (#28733) 2024-02-04 13:29:09 +00:00
options
packages [GITEA] feat(nuget): basic manifest download 2024-02-05 15:08:04 +01:00
paginator
pprof
private [CLI] implement forgejo-cli 2024-02-05 13:33:58 +01:00
process
proxy
proxyprotocol
public
queue [CI] disable redis test, no redis server yet in CI 2024-02-05 13:33:58 +01:00
recaptcha
references Add support for sha256 repositories (#23894) 2024-01-19 17:05:02 +01:00
regexplru
repository [GITEA] Allow changing the repo Wiki branch to main 2024-02-05 16:57:47 +01:00
secret [GITEA] Drop sha256-simd in favor of stdlib 2024-02-05 16:09:40 +01:00
session
setting [GITEA] Add slow SQL query warning (squash) Fix setting typo 2024-02-05 16:54:44 +01:00
sitemap
ssh
storage [CI] Forgejo Actions based CI for PR & branches 2024-02-05 13:33:59 +01:00
structs [GITEA] Allow changing the repo Wiki branch to main 2024-02-05 16:57:47 +01:00
svg
sync
system
templates [FEAT] Repository flags 2024-02-05 16:09:42 +01:00
test [TESTS] add log.Level to test.NewLogChecker 2024-02-05 16:54:44 +01:00
testlogger
timeutil
translation [I18N] add [common] as first line 2024-02-05 15:10:55 +01:00
turnstile
typesniffer
updatechecker
upload
uri
user
util [GITEA] Drop sha256-simd in favor of stdlib 2024-02-05 16:09:40 +01:00
validation [GITEA] add option for banning dots in usernames 2024-02-05 16:05:50 +01:00
web [GITEA] Configurable clone methods 2024-02-05 16:09:42 +01:00
webhook [ACTIONS] on.schedule: the event is always "schedule" 2024-02-05 16:54:44 +01:00