1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-11-24 08:57:03 -05:00
forgejo/routers/web/repo/setting
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
..
avatar.go Improve hint when uploading a too large avatar (#26935) 2023-09-07 13:35:45 +00:00
collaboration.go Improve user search display name (#29002) 2024-02-01 17:10:16 +00:00
default_branch.go Revert "Fix schedule tasks bugs (#28691)" 2024-02-05 16:54:42 +01:00
deploy_key.go Use db.Find instead of writing methods for every object (#28084) 2023-11-24 03:49:41 +00:00
git_hooks.go Move some files under repo/setting (#25585) 2023-07-02 08:59:32 +08:00
lfs.go Preserve BOM in web editor (#28935) 2024-01-27 18:02:51 +00:00
main_test.go make writing main test easier (#27270) 2023-09-28 01:38:53 +00:00
protected_branch.go Add branch protection setting for ignoring stale approvals (#28498) 2024-01-15 07:20:01 +00:00
protected_tag.go Even more db.DefaultContext refactor (#27352) 2023-10-03 10:30:41 +00:00
runners.go Fix repo count in org action settings (#27245) 2023-09-29 15:46:07 +00:00
secrets.go Fix repo count in org action settings (#27245) 2023-09-29 15:46:07 +00:00
setting.go [GITEA] Allow changing the repo Wiki branch to main 2024-02-05 16:57:47 +01:00
settings_test.go More refactoring of db.DefaultContext (#27083) 2023-09-15 06:13:19 +00:00
variables.go Added instance-level variables (#28115) 2023-12-25 07:28:59 +00:00
webhook.go Adjust object format interface (#28469) 2023-12-17 11:56:08 +00:00