From 85f931d3d5adf9d628aa3a75cfdd2f8f940f3d56 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Fri, 24 May 2013 21:24:26 -0500 Subject: [PATCH] remote-bzr: add fallback check for a partial clone Signed-off-by: Felipe Contreras Signed-off-by: Junio C Hamano --- contrib/remote-helpers/git-remote-bzr | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr index 3248586b13..3cd65723c3 100755 --- a/contrib/remote-helpers/git-remote-bzr +++ b/contrib/remote-helpers/git-remote-bzr @@ -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)