-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wiki migration from self-hosted GitLab fails if GitLab does not use master as default branch name #29000
Comments
It depends on GitLab's version: |
Thanks for your investigation and detailed report @heapifyman. I suspect the fix for this would be to either fetch the branch name from the Gitlab api or from the initial git clone when fetching the wiki. |
If I just remove line 102 The wiki seems to be cloned correctly then. I get:
I can But it does not show up in the web UI. I still only see the "Welcome to the Wiki" page - see screenshot above. |
Because Gitea uses the hardcoded |
Ah, because of https://github.com/go-gitea/gitea/blob/0b1a42ce0f7f8e22d7905bde803d60444c9a9f0b/services/wiki/wiki.go#L30C2-L30C26 I thought it would be
in https://docs.gitea.com/next/administration/config-cheat-sheet#repository-repository I tried renaming the imported wiki's default branch to "master" during migration - using function But I guess people won't expect their branch names to change just because of the import to gitea. Ideally, wiki repositories should be imported as they are, while wikis created in gitea should follow the |
We need to store the default branch in database for wiki repository first and then first this problem. |
Ok. Is there anything I could help with? |
Or we can rename GitLab's default branch to |
https://docs.gitlab.com/ee/user/project/wiki/#configure-a-default-branch-for-your-wiki |
-> Make wiki default branch name changable #29603 |
Description
When migrating a project including Wiki from a self-hosted GitLab instance the Wiki does not get migrated if GitLab does not use
master
as the default branch name.Project code will be migrated but Wiki will be empty.
The log shows the following error message:
This is probably caused by hard-coded
Branch: "master",
inMigrateRepositoryGitData
, line 102 - seegitea/modules/repository/repo.go
Line 102 in 0b1a42c
Steps to reproduce
main
- this will result in both project repository and wiki repository to usemain
as default branch nameResult
Expected Result
both code repository and wiki repository should be migrated
Gitea Version
gitea:latest and gitea:nightly
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
No response
Screenshots
Git Version
2.43.0
Operating System
Linux
How are you running Gitea?
docker compose, following instructions here: https://docs.gitea.com/next/installation/install-with-docker#basics
Database
None
The text was updated successfully, but these errors were encountered: