From d4362835271253080db30b71d7195572d7eb8ac3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20=C3=98yvind=20Karlsen?= Date: Wed, 1 Jun 2016 21:49:34 +0200 Subject: make sure target path doesn't already have svn checkout before cloning into --- MgaRepo/git.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'MgaRepo/git.py') diff --git a/MgaRepo/git.py b/MgaRepo/git.py index 01a1272..c027079 100644 --- a/MgaRepo/git.py +++ b/MgaRepo/git.py @@ -1,7 +1,8 @@ from MgaRepo import Error, config from MgaRepo.util import execcmd from MgaRepo.VCS import * -from os.path import basename, dirname, abspath +from MgaRepo.svn import SVN +from os.path import basename, dirname, abspath, lexists, join from os import chdir, getcwd import sys import re @@ -23,6 +24,8 @@ class GIT(VCS): self.env_defaults = {"GIT_SSH": self.vcs_wrapper} def clone(self, url, targetpath, **kwargs): + if lexists(join(targetpath, SVN.vcs_dirname)): + raise Error("Target path %s already contains svn checkout, aborting...") if url.split(':')[0].find("svn") < 0: return VCS.clone(self, url, **kwargs) else: -- cgit v1.2.1