From: Kevin Green Date: Mon, 11 Jun 2007 20:48:07 +0000 (-0400) Subject: git-p4: check for existence of repo dir before trying to create X-Git-Tag: v1.5.3-rc0~65^2^2~12 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c3bf3f1301319faab7344e2d8b5ab10a3d648856;p=git.git git-p4: check for existence of repo dir before trying to create When using git-p4 in this manner: git-p4 clone //depot/path/project myproject If "myproject" already exists as a dir, but not a valid git repo, it fails to create the directory. Signed-off-by: Kevin Green --- diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4 index e380c149b..cababc7fc 100755 --- a/contrib/fast-import/git-p4 +++ b/contrib/fast-import/git-p4 @@ -1400,7 +1400,8 @@ class P4Clone(P4Sync): self.cloneDestination = self.defaultDestination(args) print "Importing from %s into %s" % (', '.join(depotPaths), self.cloneDestination) - os.makedirs(self.cloneDestination) + if not os.path.exists(self.cloneDestination): + os.makedirs(self.cloneDestination) os.chdir(self.cloneDestination) system("git init") self.gitdir = os.getcwd() + "/.git"