'Handle the tail of a \'git-upload-pack\' request.
:param proto: Protocol object to read from
:param capabilities: List of negotiated capabilities
:param graph_walker: GraphWalker instance to call .ack() on
:param pack_data: Function to call with pack data
:param progress: Optional progress reporting function
:param rbufsize: Read buffer size'

def _handle_upload_pack_tail(self, proto, capabilities, graph_walker, pack_data, progress=None, rbufsize=_RBUFSIZE):

    pkt = proto.read_pkt_line()
    while pkt:
        parts = pkt.rstrip('\n').split('    ')
        if (parts[0] == 'ACK'):
            graph_walker.ack(parts[1])
        if ((len(parts) < 3) or (parts[2] not in ('ready', 'continue', 'common'))):
            break
        pkt = proto.read_pkt_line()
    if (CAPABILITY_SIDE_BAND_64K in capabilities):
        if (progress is None):
            def progress(x):
                pass
        self._read_side_band64k_data(proto, {SIDE_BAND_CHANNEL_DATA: pack_data, SIDE_BAND_CHANNEL_PROGRESS: progress})
    else:
        while True:
            data = proto.read(rbufsize)
            if (data == ''):
                break
            pack_data(data)
