forgejo/services
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 d87c526d2a)
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
agit
asymkey Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
attachment [FEAT] allow setting the update date on issues and comments 2024-02-05 14:44:33 +01:00
auth [SECURITY] Rework long-term authentication 2024-02-05 15:06:15 +01:00
automerge Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
context
convert [GITEA] Allow changing the repo Wiki branch to main 2024-02-05 16:57:47 +01:00
cron
doctor [GITEA] new doctor check: fix-push-mirrors-without-git-remote (#1853) 2024-02-05 16:09:41 +01:00
externalaccount
feed
forgejo [UPGRADE] run sanity checks before the database is upgraded 2024-02-05 14:44:33 +01:00
forms [GITEA] Optionally allow anyone to edit Wikis 2024-02-05 16:09:42 +01:00
gitdiff
indexer
issue [FEAT] allow setting the update date on issues and comments 2024-02-05 14:44:33 +01:00
lfs [GITEA] Drop sha256-simd in favor of stdlib 2024-02-05 16:09:40 +01:00
mailer [GITEA] Drop sha256-simd in favor of stdlib 2024-02-05 16:09:40 +01:00
markup
migrations [TESTS] add log.Level to test.NewLogChecker 2024-02-05 16:54:44 +01:00
mirror Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
notify [GITEA] notifies admins on new user registration 2024-02-05 16:09:28 +01:00
org
packages Propagate install_if and provider_priority to APKINDEX (#28899) 2024-02-05 05:52:56 +00:00
pull [GITEA] POST /repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments 2024-02-05 16:09:42 +01:00
release Avoid sending update/delete release notice when it is draft (#29008) 2024-02-02 04:18:12 +00:00
repository [GITEA] Allow changing the repo Wiki branch to main 2024-02-05 16:57:47 +01:00
secrets
task
uinotification
user Revert "Unify password changing and invalidate auth tokens (#27625)" 2024-02-05 14:43:35 +01:00
webhook [GITEA] Fix test TestWebhookProxy with http proxy env 2024-02-05 16:09:43 +01:00
wiki [GITEA] Allow changing the repo Wiki branch to main 2024-02-05 16:57:47 +01:00