@ -82,6 +82,7 @@ import org.eclipse.jgit.transport.BasePackFetchConnection.MultiAck;
import org.eclipse.jgit.transport.RefAdvertiser.PacketLineOutRefAdvertiser ;
import org.eclipse.jgit.transport.RefAdvertiser.PacketLineOutRefAdvertiser ;
import org.eclipse.jgit.util.io.DisabledOutputStream ;
import org.eclipse.jgit.util.io.DisabledOutputStream ;
import org.eclipse.jgit.util.io.InterruptTimer ;
import org.eclipse.jgit.util.io.InterruptTimer ;
import org.eclipse.jgit.util.io.NullOutputStream ;
import org.eclipse.jgit.util.io.TimeoutInputStream ;
import org.eclipse.jgit.util.io.TimeoutInputStream ;
import org.eclipse.jgit.util.io.TimeoutOutputStream ;
import org.eclipse.jgit.util.io.TimeoutOutputStream ;
@ -193,7 +194,7 @@ public class UploadPack {
private PacketLineOut pckOut ;
private PacketLineOut pckOut ;
private OutputStream msgOut = Disabled OutputStream. INSTANCE ;
private OutputStream msgOut = Null OutputStream. INSTANCE ;
/** The refs we advertised as existing at the start of the connection. */
/** The refs we advertised as existing at the start of the connection. */
private Map < String , Ref > refs ;
private Map < String , Ref > refs ;
@ -525,7 +526,7 @@ public class UploadPack {
pckOut = new PacketLineOut ( rawOut ) ;
pckOut = new PacketLineOut ( rawOut ) ;
service ( ) ;
service ( ) ;
} finally {
} finally {
msgOut = Disabled OutputStream. INSTANCE ;
msgOut = Null OutputStream. INSTANCE ;
walk . release ( ) ;
walk . release ( ) ;
if ( timer ! = null ) {
if ( timer ! = null ) {
try {
try {
@ -1126,6 +1127,7 @@ public class UploadPack {
} else {
} else {
preUploadHook . onSendPack ( this , wantAll , commonBase ) ;
preUploadHook . onSendPack ( this , wantAll , commonBase ) ;
}
}
msgOut . flush ( ) ;
} catch ( ServiceMayNotContinueException noPack ) {
} catch ( ServiceMayNotContinueException noPack ) {
if ( sideband & & noPack . getMessage ( ) ! = null ) {
if ( sideband & & noPack . getMessage ( ) ! = null ) {
noPack . setOutput ( ) ;
noPack . setOutput ( ) ;
@ -1209,7 +1211,7 @@ public class UploadPack {
pw . writePack ( pm , NullProgressMonitor . INSTANCE , packOut ) ;
pw . writePack ( pm , NullProgressMonitor . INSTANCE , packOut ) ;
statistics = pw . getStatistics ( ) ;
statistics = pw . getStatistics ( ) ;
if ( msgOut ! = Disabled OutputStream. INSTANCE ) {
if ( msgOut ! = Null OutputStream. INSTANCE ) {
String msg = pw . getStatistics ( ) . getMessage ( ) + '\n' ;
String msg = pw . getStatistics ( ) . getMessage ( ) + '\n' ;
msgOut . write ( Constants . encode ( msg ) ) ;
msgOut . write ( Constants . encode ( msg ) ) ;
msgOut . flush ( ) ;
msgOut . flush ( ) ;