forgejo/services
Gergely Nagy d87c526d2a
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>
2024-01-31 11:43:23 +01:00
..
actions [ACTIONS] on.schedule: the event is always "schedule" 2024-01-28 11:05:33 +01:00
agit Adjust object format interface (#28469) 2023-12-17 11:56:08 +00:00
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-01-28 08:19:26 +01:00
auth [SECURITY] Rework long-term authentication 2024-01-28 08:19:26 +01:00
automerge Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
context Another round of db.DefaultContext refactor (#27103) 2023-09-25 13:17:37 +00:00
convert Allow changing the repo Wiki branch to main 2024-01-31 11:43:23 +01:00
cron Update go dependencies (#28518) 2023-12-19 09:18:42 +08:00
doctor [GITEA] new doctor check: fix-push-mirrors-without-git-remote (#1853) 2024-01-28 10:54:59 +01:00
externalaccount Final round of db.DefaultContext refactor (#27587) 2023-10-14 08:37:24 +00:00
feed More db.DefaultContext refactor (#27265) 2023-09-29 12:12:54 +00:00
forgejo [UPGRADE] run sanity checks before the database is upgraded 2024-01-28 08:19:26 +01:00
forms [GITEA] Optionally allow anyone to edit Wikis 2024-01-28 10:54:59 +01:00
gitdiff Add option to disable ambiguous unicode characters detection (#28454) 2023-12-17 14:38:54 +00:00
indexer Fix missing issue search index update when changing status (#28325) 2023-12-03 12:22:44 +01:00
issue [FEAT] allow setting the update date on issues and comments 2024-01-28 08:19:26 +01:00
lfs [GITEA] Drop sha256-simd in favor of stdlib 2024-01-28 10:48:05 +01:00
mailer [GITEA] Drop sha256-simd in favor of stdlib 2024-01-28 10:48:05 +01:00
markup make writing main test easier (#27270) 2023-09-28 01:38:53 +00:00
migrations [TESTS] add log.Level to test.NewLogChecker 2024-01-28 11:07:43 +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-01-28 10:47:53 +01:00
org Delete repos of org when purge delete user (#27273) 2023-10-19 13:16:11 +00:00
packages [GITEA] Generate install if condition for Alpine 2024-01-28 11:06:48 +01:00
pull [GITEA] POST /repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments 2024-01-28 10:58:28 +01:00
release Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
repository Allow changing the repo Wiki branch to main 2024-01-31 11:43:23 +01:00
secrets Refactor deletion (#28610) 2023-12-25 21:25:29 +01:00
task Fix incorrect ctx usage in defer function (#27740) 2023-10-22 14:12:27 +00:00
uinotification Penultimate round of db.DefaultContext refactor (#27414) 2023-10-11 04:24:07 +00:00
user Forbid removing the last admin user (#28337) 2024-01-15 06:51:43 +00:00
webhook [GITEA] Fix test TestWebhookProxy with http proxy env 2024-01-28 10:58:28 +01:00
wiki Allow changing the repo Wiki branch to main 2024-01-31 11:43:23 +01:00