def info_refs
      @pack_type = request.params['service']
      return no_access unless authorized?

      if @pack_type.nil?
        git.update_server_info
        send_file(
          git.file('info/refs'), 'text/plain; charset=utf-8', hdr_nocache
        )
      elsif valid_pack_type?
        headers = hdr_nocache
        headers['Content-Type'] = "application/x-#{@pack_type}-advertisement"
        exchange_pack(headers, nil, {:advertise_refs => true})
      else
        not_found
      end
    end
def info_refs
      @pack_type = request.params['service']
      return no_access unless authorized?

      if @pack_type.nil?
        git.update_server_info
        send_file(
          git.file('info/refs'), 'text/plain; charset=utf-8', hdr_nocache
        )
      elsif valid_pack_type?
        headers = hdr_nocache
        headers['Content-Type'] = "application/x-#{@pack_type}-advertisement"
        exchange_pack(headers, nil, {:advertise_refs => true})
      else
        not_found
      end
    end
Processes requests for the list of refs for the requested repository.

 This works for both Smart HTTP clients and basic ones.  For basic clients,
 the Git adapter is used to update the +info/refs+ file which is then
 served to the clients.  For Smart HTTP clients, the more efficient pack
 file exchange mechanism is used.

 @return a Rack response object.