forgejo/routers/api/v1/repo
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
..
action.go
avatar.go
blob.go
branch.go Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
collaborators.go Move more functions to db.Find (#28419) 2024-01-15 02:19:25 +00:00
commits.go Update tool dependencies (#29030) 2024-02-02 19:11:39 -05:00
file.go [GITEA] Fix API inconsistencies 2024-02-05 16:09:43 +01:00
flags.go [FEAT] API support for repository flags 2024-02-05 16:09:42 +01:00
fork.go
git_hook.go
git_ref.go
hook.go
hook_test.go
issue.go [FEAT] allow setting the update date on issues and comments 2024-02-05 14:44:33 +01:00
issue_attachment.go [FEAT] allow setting the update date on issues and comments 2024-02-05 14:44:33 +01:00
issue_comment.go [GITEA] DELETE /repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments/{comment} 2024-02-05 16:09:43 +01:00
issue_comment_attachment.go [GITEA] API commentAssignment() to verify the id belongs 2024-02-05 16:09:43 +01:00
issue_dependency.go Fix issue dependencies (#27736) 2024-01-12 16:49:02 +00:00
issue_label.go [FEAT] allow setting the update date on issues and comments 2024-02-05 14:44:33 +01:00
issue_pin.go
issue_reaction.go [GITEA] API commentAssignment() to verify the id belongs 2024-02-05 16:09:43 +01:00
issue_stopwatch.go
issue_subscription.go
issue_tracked_time.go
key.go
label.go
language.go
main_test.go make writing main test easier (#27270) 2023-09-28 01:38:53 +00:00
migrate.go
milestone.go Second part of refactor db.Find (#28194) 2023-12-11 16:56:48 +08:00
mirror.go
notes.go
patch.go
pull.go Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
pull_review.go [GITEA] DELETE /repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments/{comment} 2024-02-05 16:09:43 +01:00
release.go Move more functions to db.Find (#28419) 2024-01-15 02:19:25 +00:00
release_attachment.go
release_tags.go
repo.go [GITEA] Allow changing the repo Wiki branch to main 2024-02-05 16:57:47 +01:00
repo_test.go
runners.go Add get actions runner registration token for API routes, repo, org, user and global level (#27144) 2023-12-27 07:57:54 +00:00
star.go
status.go Fix GetCommitStatuses (#28787) 2024-01-15 14:07:32 +00:00
subscriber.go
tag.go [GITEA] Document correct status code for creating Tag 2024-02-05 16:09:43 +01:00
teams.go
topic.go
transfer.go Move some repository transfer functions to service layer (#28855) 2024-02-05 06:17:23 +00:00
tree.go
wiki.go Revert "Fix an actions schedule bug (#28942)" 2024-02-05 16:53:39 +01:00