Write reflog for refs/meta/config changes
A reflog is currently only written for branches under refs/heads/.
The refs/meta/config branch has no reflog, but it contains important
information such as access rights, and hence it should have a reflog
as well.
A problem with getting a reflog for refs/meta/config is that JGit
(and also native Git) is not creating a reflog for this branch even
if core.logAllRefUpdates is set (see section 'core.logAllRefUpdates'
in [1]).
To make JGit write the reflog for the refs/meta/config branch the
reflog file for this branch must already exist. This is why the
LocalDiskRepositoryManager now creates an empty reflog file for
the refs/meta/config branch when a new repository is created.
In addition this change contains a schema migration that creates the
reflog file for the refs/meta/config branch in all existing
repositories, so that further updates get a reflog entry. This
migration is only possible if the repositories are stored on local
disk and is not executed if a GitRepositoryManager other than
LocalDiskRepositoryManager is used.
[1] https://www.kernel.org/pub/software/scm/git/docs/git-config.html#_variables
Change-Id: I9b6354cfa51263db10fb99e329b397b86f40156d
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
4 files changed