Differentiate between empty and non-existent in repository backups
Release notes
Problem to solve
When restoring from a backup a parameter is passed through from gitlab to gitaly-backup always_create
. This tells gitaly-backup
to always create this repository even if there's no backup bundle. Right now this parameters is only set to true for "project" repositories, all other repository types that have empty repositories will not have their repositories created on restore.
The parameter was added to work around the fact that when we create a backup we do not store enough information to tell the difference between an empty repository and a repository that does not exist. Git complains when trying to create an empty bundle.
This means we do not restore a system identically to the system we took a backup from.
Proposal
All backups now store the list of refs for every repository that a backup is taken from.
If there is no repository, store nothing. If there was a repository, but it was empty, create an empty ref list.
Intended users
Feature Usage Metrics
/cc @mjwood