Source:
<code>public void execute(RevWalk walk, ProgressMonitor monitor, List<String> options) throws IOException { if (!isAtomic()) { super.execute(walk, monitor, options); return; } List<ReceiveCommand> pending = ReceiveCommand.filter(getCommands(), NOT_ATTEMPTED); if (pending.isEmpty()) { return; } if (pending.size() == 1) { super.execute(walk, monitor, options); return; } if (!blockUntilTimestamps(MAX_WAIT)) { return; } if (options != null) { setPushOptions(options); } if (!checkConflictingNames(pending)) { return; } if (!checkObjectExistence(walk, pending)) { return; } if (!checkNonFastForwards(walk, pending)) { return; } try { refdb.pack( pending.stream().map(ReceiveCommand::getRefName).collect(toList())); } catch (LockFailedException e) { lockFailure(pending.get(0), pending); return; } Map<String, LockFile> locks = null; refdb.inProcessPackedRefsLock.lock(); try { Ref head = refdb.exactRef(Constants.HEAD); if (head != null) { ObjectId id = head.getObjectId(); <START> if (id != null && !id.equals(ObjectId.zeroId())) { <END> locks = lockLooseRefs(pending); if (locks == null) { return; } } } PackedRefList oldPackedList = locks != null ? refdb.pack(locks) : refdb.packedRefs.get(); RefList<Ref> newRefs = applyUpdates(walk, oldPackedList, pending); if (newRefs == null) { return; } LockFile packedRefsLock = refdb.lockPackedRefs(); if (packedRefsLock == null) { lockFailure(pending.get(0), pending); return; } refdb.commitPackedRefs(packedRefsLock, newRefs, oldPackedList, true); } finally { try { unlockAll(locks); } finally { refdb.inProcessPackedRefsLock.unlock(); } } refdb.fireRefsChanged(); pending.forEach(c -> c.setResult(ReceiveCommand.Result.OK)); writeReflog(pending); }</code><technical_language>Another alternative add a method skipLockDuringClone() CloneCommand call</technical_language>

Target:
public void execute(RevWalk walk, ProgressMonitor monitor, List<String> options) throws IOException { if (!isAtomic()) { super.execute(walk, monitor, options); return; } List<ReceiveCommand> pending = ReceiveCommand.filter(getCommands(), NOT_ATTEMPTED); if (pending.isEmpty()) { return; } if (pending.size() == 1) { super.execute(walk, monitor, options); return; } if (!blockUntilTimestamps(MAX_WAIT)) { return; } if (options != null) { setPushOptions(options); } if (!checkConflictingNames(pending)) { return; } if (!checkObjectExistence(walk, pending)) { return; } if (!checkNonFastForwards(walk, pending)) { return; } try { refdb.pack( pending.stream().map(ReceiveCommand::getRefName).collect(toList())); } catch (LockFailedException e) { lockFailure(pending.get(0), pending); return; } Map<String, LockFile> locks = null; refdb.inProcessPackedRefsLock.lock(); try { Ref head = refdb.exactRef(Constants.HEAD); if (head != null) { ObjectId id = head.getObjectId(); if (id != null && !id.equals(ObjectId.zeroId())) { locks = lockLooseRefs(pending); if (locks == null) { return; } } } PackedRefList oldPackedList = locks != null ? refdb.pack(locks) : refdb.getPackedRefs(); RefList<Ref> newRefs = applyUpdates(walk, oldPackedList, pending); if (newRefs == null) { return; } LockFile packedRefsLock = refdb.lockPackedRefs(); if (packedRefsLock == null) { lockFailure(pending.get(0), pending); return; } refdb.commitPackedRefs(packedRefsLock, newRefs, oldPackedList, true); } finally { try { unlockAll(locks); } finally { refdb.inProcessPackedRefsLock.unlock(); } } refdb.fireRefsChanged(); pending.forEach(c -> c.setResult(ReceiveCommand.Result.OK)); writeReflog(pending); }