Hello
I am attempting to create a git bundle using JGit's BundleWriter but when I attempt to add the Repository Ref objects to the BundleWriter it complains about the symbolic HEAD Ref.
Repository repo; // valid repository from elsewhere
BundlerWriter bw = new BundleWriter(repository);
for (Ref ref:refMap.values()) {
bundleWriter.include(ref);
}
Causes
java.lang.IllegalArgumentException: Invalid ref name: HEAD
at org.eclipse.jgit.transport.BundleWriter.include(BundleWriter.java:132)
If I exclude the HEAD Ref the bundle builds but when the bundle is used the missing HEAD causes the following Git error:
warning: remote HEAD refers to nonexistent ref, unable to checkout.
I would like the bundle to include the HEAD reference so that the default branch is available when the bundle is used but I cannot seem to make it happen. Can anyone help please?
Thanks in advance.