1 # Copyright (C) 2017 all contributors <repobrowse@80x24.org>
2 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
3 # frozen_string_literal: true
4 require_relative 'helper'
6 class TestClone < Test::Unit::TestCase
8 git_tmp_repo do |tmp_dir, git_dir|
9 projects = { 'repo.tmp.path' => git_dir }
10 app = Rack::Builder.new { run Repobrowse::App.new(projects) }.to_app
11 rack_server(app) do |logq, host, port|
12 url = "http://#{host}:#{port}/tmp"
14 assert system(*%W(git clone -q #{url} #{tmp_dir}/smart)),
17 assert system(*%W(git --git-dir=#{git_dir} update-server-info)),
19 env = { 'GIT_SMART_HTTP' => '0' }
20 assert system(env, *%W(git clone -q #{url} #{tmp_dir}/dumb)),