mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-01 19:15:52 +01:00
On the first synchronization, the clone has the implicit branch "master". This cannot be changed in JGit. When we fetch the refs from the repository that should be mirrored, the master branch of the clone will be updated to the revision of the remote repository (if it has a master branch). If now the master branch shall be filtered from mirroring (ie. if it is rejected), we normally would delete the ref in this clone. But because it is the current branch, it cannot be deleted. We detect this and later, after we have pushed the result, delete the master branch by pushing an empty ref to the central repository.