From a9932d0dffae1279b5260f238c71fe66fce9cad7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20=C3=98yvind=20Karlsen?= Date: Wed, 1 Jun 2016 21:51:31 +0200 Subject: fix so cloning into git repositories and updating of works targetpath specified --- MgaRepo/git.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'MgaRepo') diff --git a/MgaRepo/git.py b/MgaRepo/git.py index c027079..515fae4 100644 --- a/MgaRepo/git.py +++ b/MgaRepo/git.py @@ -25,7 +25,7 @@ class GIT(VCS): def clone(self, url, targetpath, **kwargs): if lexists(join(targetpath, SVN.vcs_dirname)): - raise Error("Target path %s already contains svn checkout, aborting...") + raise Error("Target path %s already contains svn checkout, aborting..." % targetpath) if url.split(':')[0].find("svn") < 0: return VCS.clone(self, url, **kwargs) else: @@ -46,7 +46,7 @@ class GIT(VCS): #cmd = ["svn", "init", topurl, "--trunk="+trunk, "--tags="+tags", targetpath] cmd = ["svn", "init", url, abspath(targetpath)] self._execVcs(*cmd, **kwargs) - os.environ.update({"GIT_WORK_TREE" : abspath(targetpath)}) + os.environ.update({"GIT_WORK_TREE" : abspath(targetpath), "GIT_DIR" : join(abspath(targetpath),".git")}) for entry in logentries: revisions.append(int(entry.attrib["revision"])) revisions.sort() @@ -78,7 +78,7 @@ class GIT(VCS): return None def update(self, path, **kwargs): - os.environ.update({"GIT_WORK_TREE" : abspath(path)}) + os.environ.update({"GIT_WORK_TREE" : abspath(targetpath), "GIT_DIR" : join(abspath(targetpath),".git")}) cmd = ["svn", "log", "--oneline", "--limit=1"] retval, result = self._execVcs(*cmd) -- cgit v1.2.1