Source:
private void service() throws IOException { if (isBiDirectionalPipe()) { sendAdvertisedRefs(new PacketLineOutRefAdvertiser(pckOut)); pckOut.flush(); } else getAdvertisedOrDefaultRefs(); if (hasError()) return; recvCommands(); if (hasCommands()) { Throwable unpackError = null; try { if (needPack()) { try { receivePackAndCheckConnectivity(); } catch (IOException | RuntimeException | Error err) { unpackError = err; } } if (unpackError == null) { boolean atomic = isCapabilityEnabled(CAPABILITY_ATOMIC); setAtomic(atomic); validateCommands(); if (atomic && anyRejects()) { failPendingCommands(); } preReceive.onPreReceive( this, filterCommands(Result.NOT_ATTEMPTED)); if (atomic && anyRejects()) { failPendingCommands(); } executeCommands(); } } finally { unlockPack(); } if (reportStatus) { if (echoCommandFailures && msgOut != null) { sendStatusReport(false, unpackError, new Reporter() { @Override void sendString(String s) throws IOException { msgOut.write(Constants.encode(s + "\n")); } }); msgOut.flush(); try { Thread.sleep(500); } catch (InterruptedException wakeUp) { } } sendStatusReport(true, unpackError, new Reporter() { @Override void sendString(String s) throws IOException { pckOut.writeString(s + "\n"); } }); pckOut.end(); } else if (msgOut != null) { sendStatusReport(false, unpackError, new Reporter() { @Override void sendString(String s) throws IOException { msgOut.write(Constants.encode(s + "\n")); } }); } if (unpackError != null) { try { postReceive.onPostReceive(this, filterCommands(Result.OK)); } catch (Throwable e) { } throw new UnpackException(unpackError); } postReceive.onPostReceive(this, filterCommands(Result.OK)); autoGc(); } }

Target:
private void service() throws IOException { if (isBiDirectionalPipe()) { sendAdvertisedRefs(new PacketLineOutRefAdvertiser(pckOut)); pckOut.flush(); } else getAdvertisedOrDefaultRefs(); if (hasError()) return; recvCommands(); if (hasCommands()) { Throwable unpackError = null; if (needPack()) { try { receivePackAndCheckConnectivity(); } catch (IOException | RuntimeException | Error err) { unpackError = err; } } try { if (unpackError == null) { boolean atomic = isCapabilityEnabled(CAPABILITY_ATOMIC); setAtomic(atomic); validateCommands(); if (atomic && anyRejects()) { failPendingCommands(); } preReceive.onPreReceive( this, filterCommands(Result.NOT_ATTEMPTED)); if (atomic && anyRejects()) { failPendingCommands(); } executeCommands(); } } finally { unlockPack(); } if (reportStatus) { if (echoCommandFailures && msgOut != null) { sendStatusReport(false, unpackError, new Reporter() { @Override void sendString(String s) throws IOException { msgOut.write(Constants.encode(s + "\n")); } }); msgOut.flush(); try { Thread.sleep(500); } catch (InterruptedException wakeUp) { } } sendStatusReport(true, unpackError, new Reporter() { @Override void sendString(String s) throws IOException { pckOut.writeString(s + "\n"); } }); pckOut.end(); } else if (msgOut != null) { sendStatusReport(false, unpackError, new Reporter() { @Override void sendString(String s) throws IOException { msgOut.write(Constants.encode(s + "\n")); } }); } if (unpackError != null) { try { postReceive.onPostReceive(this, filterCommands(Result.OK)); } catch (Throwable e) { } throw new UnpackException(unpackError); } postReceive.onPostReceive(this, filterCommands(Result.OK)); autoGc(); } }