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 <Kevin.Green@morganstanley.com>
Kevin Green committed
Jun 11, 2007 at 16:48 UTC
c3bf3f1301319faab7344e2d8b5ab10a3d648856
1 file changed
+2
-1
contrib/fast-import/git-p4
+2
-1
@@ -1400,7 +1400,8 @@ class P4Clone(P4Sync):
1400
self.cloneDestination = self.defaultDestination(args)
1401
1402
print "Importing from %s into %s" % (', '.join(depotPaths), self.cloneDestination)
1403
- os.makedirs(self.cloneDestination)
1403
+ if not os.path.exists(self.cloneDestination):
1404
+ os.makedirs(self.cloneDestination)
1405
os.chdir(self.cloneDestination)
1406
system("git init")
1407
self.gitdir = os.getcwd() + "/.git"