Skip to content

Wiki migration from self-hosted GitLab fails if GitLab does not use master as default branch name #29000

Closed
@heapifyman

Description

@heapifyman

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:

gitea | 2024/01/31 15:54:13 ...s/repository/repo.go:104:MigrateRepositoryGitData() [W] Clone wiki: exit status 128 - fatal: Remote branch master not found in upstream origin

This is probably caused by hard-coded Branch: "master", in MigrateRepositoryGitData, line 102 - see

Branch: "master",

Steps to reproduce

  1. Change default branch name of GitLab instance to main - this will result in both project repository and wiki repository to use main as default branch name
  2. In gitea, start a migration from GitLab
  3. Select "Wiki"
  4. Click "Migrate repository"

Result

  • Code repository is migrated
  • Wiki repository is not migrated

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

swappy-20240131_160917

swappy-20240131_163251

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions