]> source.dussan.org Git - jgit.git/commit
RefDirectory: Do not unlock until after deleting loose ref 74/1176274/3
authorNasser Grainawi <quic_nasserg@quicinc.com>
Fri, 26 Jan 2024 01:59:15 +0000 (18:59 -0700)
committerMatthias Sohn <matthias.sohn@sap.com>
Tue, 13 Feb 2024 21:37:28 +0000 (22:37 +0100)
commitacf21c0bc6a63a3d20fca92757b992a1f2d55f41
tree358570b1de147810adeb92cfe5e0e8d7067b5b67
parent86ef2d5311d99fe1b2f4961608ec1ec5fd0ae3ea
RefDirectory: Do not unlock until after deleting loose ref

Fix a potential race condition where we would remove our loose ref lock
file before deleting the loose ref itself. This race could result in the
current thread deleting a loose ref newly written by another thread.

Other callers seem to be following the correct pattern, but improve the
method naming to try to help future callers.

Change-Id: I80cebe4788edd855e15381336d980c41498fca80
Signed-off-by: Nasser Grainawi <quic_nasserg@quicinc.com>
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java