Community
Participate
Working Groups
The Git protocol v2 allows a client to request the fetching of a single symbolic refs, like HEAD. The RefDatabase and RefDirectory implementations do not consider the case of a symbolic ref, causing the full scanning of all refs and post-scan filtering by the symbolic name. When a repository contains millions of refs, performing a full scan isn't a good idea and produces unwanted memory utilisation and I/O. RefDatabase and RefDirectory should manage the special case of HEAD and perform a single scan instead of scanning and loading all refs in memory.
With the latest improvements to RefDatabase.getRefsByPrefix(String...)[1] we'll only do a single full ref scan no matter how many `ref-prefix` were sent by the git client. With this change we don't need additional handling for symbolic refs. [1] https://git.eclipse.org/r/c/jgit/jgit/+/204910
https://git.eclipse.org/r/c/jgit/jgit/+/205387 was submitted as 4f18c5095049116350828e9bb499964ea887ac02