0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-12-23 07:43:18 -05:00
forgejo/routers
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
..
api Allow changing the repo Wiki branch to main 2024-01-31 11:43:23 +01:00
common Rework markup link rendering (#26745) 2024-01-15 08:49:24 +00:00
install [GITEA] Refactor generation of JWT secret 2024-01-28 11:06:48 +01:00
private [CLI] implement forgejo-cli 2024-01-28 07:47:32 +01:00
utils
web Allow changing the repo Wiki branch to main 2024-01-31 11:43:23 +01:00
init.go [API] Forgejo API /api/forgejo/v1 2024-01-28 08:13:13 +01:00