remote-bzr: add fallback check for a partial clone
[gitweb.git] / contrib / remote-helpers / git-remote-bzr
index 3248586b13d8c1b43697cf85107a9f4708563a38..3cd65723c3ad04e0b339d17b36ece64d537f23f7 100755 (executable)
@@ -766,7 +766,10 @@ def do_list(parser):
     print
 
 def clone(path, remote_branch):
-    bdir = bzrlib.bzrdir.BzrDir.create(path)
+    try:
+        bdir = bzrlib.bzrdir.BzrDir.create(path)
+    except bzrlib.errors.AlreadyControlDirError:
+        bdir = bzrlib.bzrdir.BzrDir.open(path)
     repo = bdir.find_repository()
     repo.fetch(remote_branch.repository)
     return remote_branch.sprout(bdir, repository=repo)