Commit b66fe6ff authored by Claude Paroz's avatar Claude Paroz

Fixes #110 - Set proper directory when cloning a new git repo

Thanks Piotr Drąg for the report.
parent 17a8a290
......@@ -51,7 +51,7 @@ class GitRepo(RepoBase):
# We are assuming here that master is the first branch created
if == "master":
commands = [
['git', 'clone', self.branch.module.vcs_root, str(self.branch.co_path.parent)],
['git', 'clone', self.branch.module.vcs_root, str(self.branch.co_path)],
['git', 'remote', 'update'],
['git', 'checkout',],
......@@ -96,6 +96,14 @@ class ModuleTestCase(TestCase):
response = self.client.get(reverse('module', args=[]))
self.assertContains(response, "Sorry, no known locations to report bugs for this module.")
def test_first_branch_creation(self):
mod = Module.objects.create(name='eog', vcs_type='git', vcs_root='')
br = Branch(module=mod, name='master')
with patch_shell_command() as cmds:
self.assertTrue('git clone %s/git/eog' % settings.SCRATCHDIR in cmds)
def test_branch_methods(self):
branch = Branch(module=self.mod, name='master')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment