PackedBatchRefUpdate: Handle the case where loose refs fail to pack

If packing loose refs fails due to a lock failure, reject update with
a LOCK_FAILURE.

Change-Id: I100e81efd528d963231a1b87bacd9d68f9245a1b
Signed-off-by: Kaushik Lingarkar <quic_kaushikl@quicinc.com>
This commit is contained in:
Kaushik Lingarkar 2023-04-13 14:41:37 -07:00 committed by Matthias Sohn
parent 2e3f12a0fc
commit 8f8bc703e9
1 changed files with 6 additions and 1 deletions

View File

@ -168,7 +168,12 @@ public void execute(RevWalk walk, ProgressMonitor monitor,
if (locks == null) {
return;
}
refdb.pack(locks);
try {
refdb.pack(locks);
} catch (LockFailedException e) {
lockFailure(pending.get(0), pending);
return;
}
}
LockFile packedRefsLock = refdb.lockPackedRefs();