mirror of
https://github.com/klaussilveira/gitlist.git
synced 2026-02-16 03:27:40 +01:00
Use checked-out branch as default branch.
Previously assumed 'master' was the default branch, when master may not exist at all.
This commit is contained in:
@@ -79,6 +79,16 @@ class InterfaceTest extends WebTestCase
|
||||
$repository->commit("Changing branch");
|
||||
$repository->checkout("master");
|
||||
|
||||
// master-less repository fixture
|
||||
$git->createRepository(self::$tmpdir . 'masterless');
|
||||
$repository = $git->getRepository(self::$tmpdir . 'masterless');
|
||||
$repository = $repository->checkout('develop');
|
||||
file_put_contents(self::$tmpdir . 'masterless/README.md', "## masterless\nmasterless is a *test* repository!");
|
||||
file_put_contents(self::$tmpdir . 'masterless/test.php', "<?php\necho 'Hello World'; // This is a test");
|
||||
$repository->setConfig('user.name', 'Luke Skywalker');
|
||||
$repository->setConfig('user.email', 'luke@rebel.org');
|
||||
$repository->addAll();
|
||||
$repository->commit("Initial commit");
|
||||
}
|
||||
|
||||
public function createApplication()
|
||||
@@ -241,6 +251,14 @@ class InterfaceTest extends WebTestCase
|
||||
$this->assertRegexp('/NESTED TEST REPO README/', $client->getResponse()->getContent());
|
||||
}
|
||||
|
||||
public function testMasterlessRepo()
|
||||
{
|
||||
$client = $this->createClient();
|
||||
|
||||
$crawler = $client->request('GET', '/masterless/');
|
||||
$this->assertTrue($client->getResponse()->isOk());
|
||||
}
|
||||
|
||||
public function testNestedRepoBranch()
|
||||
{
|
||||
$client = $this->createClient();
|
||||
|
||||
Reference in New Issue
Block a user