130
130
lazy_check_versions()
132
131
# we dont grok readonly - git isn't integrated with transport.
134
if url.startswith('readonly+'):
135
url = url[len('readonly+'):]
132
from bzrlib.transport.local import LocalTransport
133
if isinstance(transport, LocalTransport):
138
135
gitrepo = dulwich.repo.Repo(transport.local_abspath(".").encode(osutils._fs_enc))
139
except bzr_errors.NotLocalUrl:
140
raise bzr_errors.NotBranchError(path=transport.base)
137
from bzrlib.plugins.git.transportgit import TransportRepo
138
gitrepo = TransportRepo(transport)
141
139
from bzrlib.plugins.git.dir import LocalGitDir, GitLockableFiles, GitLock
142
140
lockfiles = GitLockableFiles(transport, GitLock())
143
141
return LocalGitDir(transport, lockfiles, gitrepo, self)
146
144
def probe_transport(klass, transport):
147
"""Our format is present if the transport ends in '.not/'."""
148
from bzrlib.transport.local import LocalTransport
150
if not isinstance(transport, LocalTransport):
151
raise bzr_errors.NotBranchError(path=transport.base)
153
# This should quickly filter out most things that are not
154
# git repositories, saving us the trouble from loading dulwich.
155
if not transport.has(".git") and not transport.has("objects"):
156
raise bzr_errors.NotBranchError(path=transport.base)
158
145
lazy_check_versions()