Source:
private void service() throws IOException { boolean sendPack = false; try { if (biDirectionalPipe) sendAdvertisedRefs(new PacketLineOutRefAdvertiser(pckOut)); else if (requestValidator instanceof AnyRequestValidator) advertised = Collections.emptySet(); else advertised = refIdSet(getAdvertisedOrDefaultRefs().values()); recvWants(); if (wantIds.isEmpty()) { preUploadHook.onBeginNegotiateRound(this, wantIds, 0); preUploadHook.onEndNegotiateRound(this, wantIds, 0, 0, false); return; } if (options.contains(OPTION_MULTI_ACK_DETAILED)) { multiAck = MultiAck.DETAILED; noDone = options.contains(OPTION_NO_DONE); } else if (options.contains(OPTION_MULTI_ACK)) multiAck = MultiAck.CONTINUE; else multiAck = MultiAck.OFF; if (!clientShallowCommits.isEmpty()) verifyClientShallow(); if (depth != 0) processShallow(); if (!clientShallowCommits.isEmpty()) walk.assumeShallow(clientShallowCommits); sendPack = negotiate(); } catch (ServiceMayNotContinueException err) { if (!err.isOutput() && err.getMessage() != null) { try { pckOut.writeString("ERR " + err.getMessage() + "\n"); err.setOutput(); } catch (Throwable err2) { } } throw err; } catch (IOException | RuntimeException | Error err) { boolean output = false; try { String msg = err instanceof PackProtocolException ? err.getMessage() : JGitText.get().internalServerError; pckOut.writeString("ERR " + msg + "\n"); output = true; } catch (Throwable err2) { } if (output) { throw new UploadPackInternalServerErrorException(err); } throw err; } finally { if (!sendPack && !biDirectionalPipe) { while (0 < rawIn.skip(2048) || 0 <= rawIn.read()) { } } rawOut.stopBuffering(); } if (sendPack) sendPack(); }

Target:
private void service() throws IOException { boolean sendPack = false; try { if (biDirectionalPipe) sendAdvertisedRefs(new PacketLineOutRefAdvertiser(pckOut)); else if (requestValidator instanceof AnyRequestValidator) advertised = Collections.emptySet(); else advertised = refIdSet(getAdvertisedOrDefaultRefs().values()); recvWants(); if (wantIds.isEmpty()) { preUploadHook.onBeginNegotiateRound(this, wantIds, 0); preUploadHook.onEndNegotiateRound(this, wantIds, 0, 0, false); return; } if (options.contains(OPTION_MULTI_ACK_DETAILED)) { multiAck = MultiAck.DETAILED; noDone = options.contains(OPTION_NO_DONE); } else if (options.contains(OPTION_MULTI_ACK)) multiAck = MultiAck.CONTINUE; else multiAck = MultiAck.OFF; if (!clientShallowCommits.isEmpty()) verifyClientShallow(); if (depth != 0) processShallow(); if (!clientShallowCommits.isEmpty()) walk.assumeShallow(clientShallowCommits); sendPack = negotiate(); if (sendPack && !biDirectionalPipe) { int eof = rawIn.read(); if (0 <= eof) { sendPack = false; throw new CorruptObjectException(MessageFormat.format( JGitText.get().expectedEOFReceived, "\\x" + Integer.toHexString(eof))); } } } catch (ServiceMayNotContinueException err) { if (!err.isOutput() && err.getMessage() != null) { try { pckOut.writeString("ERR " + err.getMessage() + "\n"); err.setOutput(); } catch (Throwable err2) { } } throw err; } catch (IOException | RuntimeException | Error err) { boolean output = false; try { String msg = err instanceof PackProtocolException ? err.getMessage() : JGitText.get().internalServerError; pckOut.writeString("ERR " + msg + "\n"); output = true; } catch (Throwable err2) { } if (output) { throw new UploadPackInternalServerErrorException(err); } throw err; } finally { if (!sendPack && !biDirectionalPipe) { while (0 < rawIn.skip(2048) || 0 <= rawIn.read()) { } } rawOut.stopBuffering(); } if (sendPack) sendPack(); }