remote-bzr: add fallback check for a partial clone
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
parent
e56660a73f
commit
85f931d3d5
|
|
@ -766,7 +766,10 @@ def do_list(parser):
|
||||||
print
|
print
|
||||||
|
|
||||||
def clone(path, remote_branch):
|
def clone(path, remote_branch):
|
||||||
|
try:
|
||||||
bdir = bzrlib.bzrdir.BzrDir.create(path)
|
bdir = bzrlib.bzrdir.BzrDir.create(path)
|
||||||
|
except bzrlib.errors.AlreadyControlDirError:
|
||||||
|
bdir = bzrlib.bzrdir.BzrDir.open(path)
|
||||||
repo = bdir.find_repository()
|
repo = bdir.find_repository()
|
||||||
repo.fetch(remote_branch.repository)
|
repo.fetch(remote_branch.repository)
|
||||||
return remote_branch.sprout(bdir, repository=repo)
|
return remote_branch.sprout(bdir, repository=repo)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue