Mirror repository for blank project fails
Summary
Pull from a remote repository fails for a blank repository because master
branch is created when Mirror repository is set.
Steps to reproduce
- Create a new project
- Navigate to
/settings/repository
- Scroll down to Pull from a remote repository
- Select Mirror repository and add Git repository URL
- Click Save Changes
- Observe success message
- Navigate to Repository
- Observe a blank
README.md
has been added on branchmaster
- Navigate back to
/settings/repository
- Observe mirroring failed with error message: "The repository failed to update X minutes ago. Branch already exists"
- Click Update Now
- Observe mirroring failed with error message: "The default branch (master) has diverged from its upstream counterpart and could not be updated automatically."
What is the current bug behavior?
Mirroring fails because i) a master
branch is created, and ii) a blank README.md
is added, causing master
to diverge from upstream.
What is the expected correct behavior?
No branch or README should be created and mirroring should complete successfully.
Output of checks
This bug happens on GitLab.com
Links
Edited by Collen