code: func uploadPack(w io.WriteCloser, r io.Reader, req *packp.UploadPackRequest) error {
  	// TODO support multi_ack mode
  	// TODO support multi_ack_detailed mode
  	// TODO support acks for common objects
  	// TODO build a proper state machine for all these processing options
  
  	if err := req.UploadRequest.Encode(w); err != nil {
  		return fmt.Errorf("sending upload-req message: %s", err)
  	}
  
  	if err := req.UploadHaves.Encode(w, true); err != nil {
  		return fmt.Errorf("sending haves message: %s", err)
  	}
  
  	if err := sendDone(w); err != nil {
  		return fmt.Errorf("sending done message: %s", err)
  	}
  
  	if err := w.Close(); err != nil {
  		return fmt.Errorf("closing input: %s", err)
  	}
  
  	return nil
  }
docs: // uploadPack implements the git-upload-pack protocol.