summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorKaushik Lingarkar <quic_kaushikl@quicinc.com>2023-04-13 14:41:37 -0700
committerMatthias Sohn <matthias.sohn@sap.com>2023-04-18 09:06:27 +0200
commit8f8bc703e9e19493b7f85cdae88b6c88a5bbd9a0 (patch)
tree1eb9f5dad4f72b8a070332f8d3187ba03e19a66e /org.eclipse.jgit
parent2e3f12a0fc63deba80e725bfa985c0c5bd31de99 (diff)
downloadjgit-8f8bc703e9e19493b7f85cdae88b6c88a5bbd9a0.tar.gz
jgit-8f8bc703e9e19493b7f85cdae88b6c88a5bbd9a0.zip
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>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackedBatchRefUpdate.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackedBatchRefUpdate.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackedBatchRefUpdate.java
index 560b807565..a9e05c92ae 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackedBatchRefUpdate.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackedBatchRefUpdate.java
@@ -168,7 +168,12 @@ class PackedBatchRefUpdate extends BatchRefUpdate {
if (locks == null) {
return;
}
- refdb.pack(locks);
+ try {
+ refdb.pack(locks);
+ } catch (LockFailedException e) {
+ lockFailure(pending.get(0), pending);
+ return;
+ }
}
LockFile packedRefsLock = refdb.lockPackedRefs();