@ -2192,6 +2192,49 @@ public class ReceivePack {
public void receive ( final InputStream input , final OutputStream output ,
public void receive ( final InputStream input , final OutputStream output ,
final OutputStream messages ) throws IOException {
final OutputStream messages ) throws IOException {
init ( input , output , messages ) ;
init ( input , output , messages ) ;
try {
service ( ) ;
} catch ( PackProtocolException e ) {
fatalError ( e . getMessage ( ) ) ;
throw e ;
} catch ( InputOverLimitIOException e ) {
String msg = JGitText . get ( ) . tooManyCommands ;
fatalError ( msg ) ;
throw new PackProtocolException ( msg ) ;
} finally {
try {
close ( ) ;
} finally {
release ( ) ;
}
}
}
/ * *
* Execute the receive task on the socket .
*
* < p >
* Same as { @link # receive } , but the exceptions are not reported to the
* client yet .
*
* @param input
* raw input to read client commands and pack data from . Caller
* must ensure the input is buffered , otherwise read performance
* may suffer .
* @param output
* response back to the Git network client . Caller must ensure
* the output is buffered , otherwise write performance may
* suffer .
* @param messages
* secondary "notice" channel to send additional messages out
* through . When run over SSH this should be tied back to the
* standard error channel of the command execution . For most
* other network connections this should be null .
* @throws java . io . IOException
* /
public void receiveWithExceptionPropagation ( InputStream input ,
OutputStream output , OutputStream messages ) throws IOException {
init ( input , output , messages ) ;
try {
try {
service ( ) ;
service ( ) ;
} finally {
} finally {
@ -2212,16 +2255,7 @@ public class ReceivePack {
if ( hasError ( ) )
if ( hasError ( ) )
return ;
return ;
try {
recvCommands ( ) ;
recvCommands ( ) ;
} catch ( PackProtocolException e ) {
fatalError ( e . getMessage ( ) ) ;
throw e ;
} catch ( InputOverLimitIOException e ) {
String msg = JGitText . get ( ) . tooManyCommands ;
fatalError ( msg ) ;
throw new PackProtocolException ( msg ) ;
}
if ( hasCommands ( ) ) {
if ( hasCommands ( ) ) {
try ( PostReceiveExecutor e = new PostReceiveExecutor ( ) ) {
try ( PostReceiveExecutor e = new PostReceiveExecutor ( ) ) {