Browse Source
When we are cloning we have no refs at all yet, and there cannot (or at least should not) be any other thread doing something with refs yet. Locking loose refs is thus not needed, since there are no loose refs yet and nothing should be trying to create them concurrently. Let's skip the whole loose ref locking when we are cloning a repository. As a result, JGit will write the refs directly to the packed-refs file, and will not create the refs/remotes/ directories nor the lock files underneath when cloning and packed refs are used. Since no lock files are created, any problems on case-insensitive file systems with tag or branch names that differ only in case are avoided during cloning. Detect if we are cloning based on the following heuristics: * HEAD is a dangling symref * There is no loose ref * There is no packed-refs file Note, however, that there may still be problems with such tag or branch names later on. This is primarily a five-minutes-past-twelve stop-gap measure to resolve the referenced bug, which affects the Oxygen.2 release. Bug: 528497 Change-Id: I57860c29c210568165276a123b855e462b6a107a Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>stable-4.9
Thomas Wolf
7 years ago
committed by
Matthias Sohn
2 changed files with 37 additions and 5 deletions
Loading…
Reference in new issue