13
14
# You should have received a copy of the GNU General Public License
14
15
# along with this program; if not, write to the Free Software
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
18
"""An adapter between a Git Repository and a Bazaar Branch"""
35
from bzrlib.foreign import (
38
from bzrlib.trace import mutter
39
from bzrlib.transport import get_transport
41
from bzrlib.plugins.git.foreign import (
44
from bzrlib.plugins.git.mapping import default_mapping
46
from bzrlib.plugins.git import git
49
class GitTags(object):
51
def __init__(self, tags):
55
return iter(self._tags)
26
revision as _mod_revision,
31
from ..decorators import only_raises
32
from ..foreign import (
39
from .filegraph import (
40
GitFileLastChangeScanner,
41
GitFileParentProvider,
43
from .mapping import (
53
from dulwich.errors import (
56
from dulwich.objects import (
60
from dulwich.object_store import (
65
class GitCheck(check.Check):
67
def __init__(self, repository, check_repo=True):
68
self.repository = repository
69
self.check_repo = check_repo
70
self.checked_rev_cnt = 0
71
self.object_count = None
74
def check(self, callback_refs=None, check_repo=True):
75
if callback_refs is None:
77
with self.repository.lock_read(), \
78
ui.ui_factory.nested_progress_bar() as self.progress:
79
shas = set(self.repository._git.object_store)
80
self.object_count = len(shas)
81
# TODO(jelmer): Check more things
82
for i, sha in enumerate(shas):
83
self.progress.update('checking objects', i, self.object_count)
84
o = self.repository._git.object_store[sha]
87
except Exception as e:
88
self.problems.append((sha, e))
90
def _report_repo_results(self, verbose):
91
trace.note('checked repository {0} format {1}'.format(
92
self.repository.user_url,
93
self.repository._format))
94
trace.note('%6d objects', self.object_count)
95
for sha, problem in self.problems:
96
trace.note('%s: %s', sha, problem)
98
def report_results(self, verbose):
100
self._report_repo_results(verbose)
103
_optimisers_loaded = False
106
def lazy_load_optimisers():
107
global _optimisers_loaded
108
if _optimisers_loaded:
110
from . import interrepo
111
for optimiser in [interrepo.InterRemoteGitNonGitRepository,
112
interrepo.InterLocalGitNonGitRepository,
113
interrepo.InterLocalGitLocalGitRepository,
114
interrepo.InterRemoteGitLocalGitRepository,
115
interrepo.InterToLocalGitRepository,
116
interrepo.InterToRemoteGitRepository,
118
repository.InterRepository.register_optimiser(optimiser)
119
_optimisers_loaded = True
58
122
class GitRepository(ForeignRepository):
59
123
"""An adapter to git repositories for bzr."""
61
125
_serializer = None
63
def __init__(self, gitdir, lockfiles):
64
ForeignRepository.__init__(self, GitFormat(), gitdir, lockfiles)
65
from bzrlib.plugins.git import fetch
66
repository.InterRepository.register_optimiser(fetch.InterGitRepository)
126
vcs = foreign_vcs_git
129
def __init__(self, gitdir):
130
self._transport = gitdir.root_transport
131
super(GitRepository, self).__init__(GitRepositoryFormat(),
132
gitdir, control_files=None)
133
self.base = gitdir.root_transport.base
134
lazy_load_optimisers()
135
self._lock_mode = None
138
def add_fallback_repository(self, basis_url):
139
raise errors.UnstackableRepositoryFormat(self._format,
140
self.control_transport.base)
68
142
def is_shared(self):
145
def get_physical_lock_status(self):
148
def lock_write(self):
149
"""See Branch.lock_write()."""
151
if self._lock_mode != 'w':
152
raise errors.ReadOnlyError(self)
153
self._lock_count += 1
155
self._lock_mode = 'w'
157
self._transaction = transactions.WriteTransaction()
158
return repository.RepositoryWriteLockResult(self.unlock, None)
160
def break_lock(self):
161
raise NotImplementedError(self.break_lock)
163
def dont_leave_lock_in_place(self):
164
raise NotImplementedError(self.dont_leave_lock_in_place)
166
def leave_lock_in_place(self):
167
raise NotImplementedError(self.leave_lock_in_place)
171
if self._lock_mode not in ('r', 'w'):
173
self._lock_count += 1
175
self._lock_mode = 'r'
177
self._transaction = transactions.ReadOnlyTransaction()
178
return lock.LogicalLockResult(self.unlock)
180
@only_raises(errors.LockNotHeld, errors.LockBroken)
182
if self._lock_count == 0:
183
raise errors.LockNotHeld(self)
184
if self._lock_count == 1 and self._lock_mode == 'w':
185
if self._write_group is not None:
186
self.abort_write_group()
187
self._lock_count -= 1
188
self._lock_mode = None
189
raise errors.BzrError(
190
'Must end write groups before releasing write locks.')
191
self._lock_count -= 1
192
if self._lock_count == 0:
193
self._lock_mode = None
194
transaction = self._transaction
195
self._transaction = None
198
def is_write_locked(self):
199
return (self._lock_mode == 'w')
202
return (self._lock_mode is not None)
204
def get_transaction(self):
205
"""See Repository.get_transaction()."""
206
if self._transaction is None:
207
return transactions.PassThroughTransaction()
209
return self._transaction
211
def reconcile(self, other=None, thorough=False):
212
"""Reconcile this repository."""
213
from ..reconcile import ReconcileResult
214
ret = ReconcileResult()
71
218
def supports_rich_root(self):
74
def _warn_if_deprecated(self):
75
# This class isn't deprecated
78
221
def get_mapping(self):
79
222
return default_mapping
81
224
def make_working_trees(self):
225
return not self._git.get_config().get_boolean(("core", ), "bare")
227
def revision_graph_can_have_wrong_parents(self):
230
def add_signature_text(self, revid, signature):
231
raise errors.UnsupportedOperation(self.add_signature_text, self)
233
def sign_revision(self, revision_id, gpg_strategy):
234
raise errors.UnsupportedOperation(self.add_signature_text, self)
85
237
class LocalGitRepository(GitRepository):
238
"""Git repository on the file system."""
87
def __init__(self, gitdir, lockfiles):
88
# FIXME: This also caches negatives. Need to be more careful
89
# about this once we start writing to git
90
self._parents_provider = graph.CachingParentsProvider(self)
91
GitRepository.__init__(self, gitdir, lockfiles)
92
self.base = gitdir.root_transport.base
240
def __init__(self, gitdir):
241
GitRepository.__init__(self, gitdir)
93
242
self._git = gitdir._git
95
self.signatures = versionedfiles.VirtualSignatureTexts(self)
96
self.revisions = versionedfiles.VirtualRevisionTexts(self)
97
self.tags = GitTags(self._git.get_tags())
243
self._file_change_scanner = GitFileLastChangeScanner(self)
244
self._transaction = None
246
def get_commit_builder(self, branch, parents, config, timestamp=None,
247
timezone=None, committer=None, revprops=None,
248
revision_id=None, lossy=False):
249
"""Obtain a CommitBuilder for this repository.
251
:param branch: Branch to commit to.
252
:param parents: Revision ids of the parents of the new revision.
253
:param config: Configuration to use.
254
:param timestamp: Optional timestamp recorded for commit.
255
:param timezone: Optional timezone for timestamp.
256
:param committer: Optional committer to set for commit.
257
:param revprops: Optional dictionary of revision properties.
258
:param revision_id: Optional revision id.
259
:param lossy: Whether to discard data that can not be natively
260
represented, when pushing to a foreign VCS
262
builder = GitCommitBuilder(
263
self, parents, config, timestamp, timezone, committer, revprops,
265
self.start_write_group()
268
def get_file_graph(self):
269
return _mod_graph.Graph(GitFileParentProvider(
270
self._file_change_scanner))
272
def iter_files_bytes(self, desired_files):
273
"""Iterate through file versions.
275
Files will not necessarily be returned in the order they occur in
276
desired_files. No specific order is guaranteed.
278
Yields pairs of identifier, bytes_iterator. identifier is an opaque
279
value supplied by the caller as part of desired_files. It should
280
uniquely identify the file version in the caller's context. (Examples:
281
an index number or a TreeTransform trans_id.)
283
bytes_iterator is an iterable of bytestrings for the file. The
284
kind of iterable and length of the bytestrings are unspecified, but for
285
this implementation, it is a list of bytes produced by
286
VersionedFile.get_record_stream().
288
:param desired_files: a list of (file_id, revision_id, identifier)
292
for (file_id, revision_id, identifier) in desired_files:
293
per_revision.setdefault(revision_id, []).append(
294
(file_id, identifier))
295
for revid, files in per_revision.items():
297
(commit_id, mapping) = self.lookup_bzr_revision_id(revid)
298
except errors.NoSuchRevision:
299
raise errors.RevisionNotPresent(revid, self)
301
commit = self._git.object_store[commit_id]
303
raise errors.RevisionNotPresent(revid, self)
304
root_tree = commit.tree
305
for fileid, identifier in files:
307
path = mapping.parse_file_id(fileid)
309
raise errors.RevisionNotPresent((fileid, revid), self)
311
obj = tree_lookup_path(
312
self._git.object_store.__getitem__, root_tree,
313
path.encode('utf-8'))
314
if isinstance(obj, tuple):
315
(mode, item_id) = obj
316
obj = self._git.object_store[item_id]
318
raise errors.RevisionNotPresent((fileid, revid), self)
320
if obj.type_name == b"tree":
321
yield (identifier, [])
322
elif obj.type_name == b"blob":
323
yield (identifier, obj.chunked)
325
raise AssertionError("file text resolved to %r" % obj)
327
def gather_stats(self, revid=None, committers=None):
328
"""See Repository.gather_stats()."""
329
result = super(LocalGitRepository, self).gather_stats(
332
for sha in self._git.object_store:
333
o = self._git.object_store[sha]
334
if o.type_name == b"commit":
336
result['revisions'] = len(revs)
339
def _iter_revision_ids(self):
340
mapping = self.get_mapping()
341
for sha in self._git.object_store:
342
o = self._git.object_store[sha]
343
if not isinstance(o, Commit):
345
revid = mapping.revision_id_foreign_to_bzr(o.id)
99
348
def all_revision_ids(self):
100
ret = set([revision.NULL_REVISION])
101
if self._git.heads() == []:
103
bzr_heads = [self.get_mapping().revision_id_foreign_to_bzr(h) for h in self._git.heads()]
105
graph = self.get_graph()
106
for rev, parents in graph.iter_ancestry(bzr_heads):
350
for git_sha, revid in self._iter_revision_ids():
354
def _get_parents(self, revid, no_alternates=False):
355
if type(revid) != bytes:
358
(hexsha, mapping) = self.lookup_bzr_revision_id(revid)
359
except errors.NoSuchRevision:
361
# FIXME: Honor no_alternates setting
363
commit = self._git.object_store[hexsha]
367
for p in commit.parents:
369
ret.append(self.lookup_foreign_revision_id(p, mapping))
371
ret.append(mapping.revision_id_foreign_to_bzr(p))
110
#def get_revision_delta(self, revision_id):
111
# parent_revid = self.get_revision(revision_id).parent_ids[0]
112
# diff = self._git.diff(ids.convert_revision_id_bzr_to_git(parent_revid),
113
# ids.convert_revision_id_bzr_to_git(revision_id))
115
def _make_parents_provider(self):
116
"""See Repository._make_parents_provider()."""
117
return self._parents_provider
119
def get_parent_map(self, revids):
374
def _get_parent_map_no_fallbacks(self, revids):
375
return self.get_parent_map(revids, no_alternates=True)
377
def get_parent_map(self, revids, no_alternates=False):
121
mutter("get_parent_map(%r)", revids)
122
379
for revision_id in revids:
123
assert isinstance(revision_id, str)
124
if revision_id == revision.NULL_REVISION:
380
parents = self._get_parents(
381
revision_id, no_alternates=no_alternates)
382
if revision_id == _mod_revision.NULL_REVISION:
125
383
parent_map[revision_id] = ()
127
hexsha = self.lookup_git_revid(revision_id, self.get_mapping())
128
commit = self._git.commit(hexsha)
132
parent_map[revision_id] = [self.get_mapping().revision_id_foreign_to_bzr(p) for p in commit.parents]
387
if len(parents) == 0:
388
parents = [_mod_revision.NULL_REVISION]
389
parent_map[revision_id] = tuple(parents)
133
390
return parent_map
135
def get_ancestry(self, revision_id, topo_sorted=True):
136
"""See Repository.get_ancestry().
392
def get_known_graph_ancestry(self, revision_ids):
393
"""Return the known graph for a set of revision ids and their ancestors.
138
if revision_id is None:
139
return self._all_revision_ids()
140
assert isinstance(revision_id, str)
142
graph = self.get_graph()
143
for rev, parents in graph.iter_ancestry([revision_id]):
144
if rev == revision.NULL_REVISION:
395
pending = set(revision_ids)
399
for revid in pending:
400
if revid == _mod_revision.NULL_REVISION:
402
parents = self._get_parents(revid)
403
if parents is not None:
404
this_parent_map[revid] = parents
405
parent_map.update(this_parent_map)
407
for values in this_parent_map.values():
408
pending.update(values)
409
pending = pending.difference(parent_map)
410
return _mod_graph.KnownGraph(parent_map)
150
412
def get_signature_text(self, revision_id):
151
raise errors.NoSuchRevision(self, revision_id)
153
def lookup_revision_id(self, revid):
413
git_commit_id, mapping = self.lookup_bzr_revision_id(revision_id)
415
commit = self._git.object_store[git_commit_id]
417
raise errors.NoSuchRevision(self, revision_id)
418
if commit.gpgsig is None:
419
raise errors.NoSuchRevision(self, revision_id)
422
def check(self, revision_ids=None, callback_refs=None, check_repo=True):
423
result = GitCheck(self, check_repo=check_repo)
424
result.check(callback_refs)
427
def pack(self, hint=None, clean_obsolete_packs=False):
428
self._git.object_store.pack_loose_objects()
430
def lookup_foreign_revision_id(self, foreign_revid, mapping=None):
154
431
"""Lookup a revision id.
156
:param revid: Bazaar revision id.
157
:return: Tuple with git revisionid and mapping.
433
:param foreign_revid: Foreign revision id to look up
434
:param mapping: Mapping to use (use default mapping if not specified)
435
:raise KeyError: If foreign revision was not found
436
:return: bzr revision id
159
# Yes, this doesn't really work, but good enough as a stub
160
return osutils.sha(rev_id).hexdigest(), self.get_mapping()
438
if not isinstance(foreign_revid, bytes):
439
raise TypeError(foreign_revid)
441
mapping = self.get_mapping()
442
if foreign_revid == ZERO_SHA:
443
return _mod_revision.NULL_REVISION
444
commit = self._git.object_store.peel_sha(foreign_revid)
445
if not isinstance(commit, Commit):
446
raise NotCommitError(commit.id)
447
revid = mapping.get_revision_id(commit)
448
# FIXME: check testament before doing this?
162
451
def has_signature_for_revision_id(self, revision_id):
165
def lookup_git_revid(self, bzr_revid, mapping):
167
return mapping.revision_id_bzr_to_foreign(bzr_revid)
452
"""Check whether a GPG signature is present for this revision.
454
This is never the case for Git repositories.
457
self.get_signature_text(revision_id)
458
except errors.NoSuchRevision:
463
def verify_revision_signature(self, revision_id, gpg_strategy):
464
"""Verify the signature on a revision.
466
:param revision_id: the revision to verify
467
:gpg_strategy: the GPGStrategy object to used
469
:return: gpg.SIGNATURE_VALID or a failed SIGNATURE_ value
471
from breezy import gpg
472
with self.lock_read():
473
git_commit_id, mapping = self.lookup_bzr_revision_id(revision_id)
475
commit = self._git.object_store[git_commit_id]
477
raise errors.NoSuchRevision(self, revision_id)
479
if commit.gpgsig is None:
480
return gpg.SIGNATURE_NOT_SIGNED, None
482
without_sig = Commit.from_string(commit.as_raw_string())
483
without_sig.gpgsig = None
485
(result, key, plain_text) = gpg_strategy.verify(
486
without_sig.as_raw_string(), commit.gpgsig)
489
def lookup_bzr_revision_id(self, bzr_revid, mapping=None):
490
"""Lookup a bzr revision id in a Git repository.
492
:param bzr_revid: Bazaar revision id
493
:param mapping: Optional mapping to use
494
:return: Tuple with git commit id, mapping that was used and supplement
498
(git_sha, mapping) = mapping_registry.revision_id_bzr_to_foreign(
168
500
except errors.InvalidRevisionId:
169
501
raise errors.NoSuchRevision(self, bzr_revid)
503
return (git_sha, mapping)
171
505
def get_revision(self, revision_id):
172
git_commit_id = self.lookup_git_revid(revision_id, self.get_mapping())
506
if not isinstance(revision_id, bytes):
507
raise errors.InvalidRevisionId(revision_id, self)
508
git_commit_id, mapping = self.lookup_bzr_revision_id(revision_id)
174
commit = self._git.commit(git_commit_id)
510
commit = self._git.object_store[git_commit_id]
176
512
raise errors.NoSuchRevision(self, revision_id)
177
# print "fetched revision:", git_commit_id
178
revision = self.get_mapping().import_commit(commit)
179
assert revision is not None
513
revision, roundtrip_revid, verifiers = mapping.import_commit(
514
commit, self.lookup_foreign_revision_id, strict=False)
517
# FIXME: check verifiers ?
519
revision.revision_id = roundtrip_revid
182
522
def has_revision(self, revision_id):
523
"""See Repository.has_revision."""
524
if revision_id == _mod_revision.NULL_REVISION:
184
self.get_revision(revision_id)
527
git_commit_id, mapping = self.lookup_bzr_revision_id(revision_id)
185
528
except errors.NoSuchRevision:
190
def get_revisions(self, revids):
191
return [self.get_revision(r) for r in revids]
530
return (git_commit_id in self._git)
532
def has_revisions(self, revision_ids):
533
"""See Repository.has_revisions."""
534
return set(filter(self.has_revision, revision_ids))
536
def iter_revisions(self, revision_ids):
537
"""See Repository.get_revisions."""
538
for revid in revision_ids:
540
rev = self.get_revision(revid)
541
except errors.NoSuchRevision:
193
545
def revision_trees(self, revids):
546
"""See Repository.revision_trees."""
194
547
for revid in revids:
195
548
yield self.revision_tree(revid)
197
550
def revision_tree(self, revision_id):
198
revision_id = revision.ensure_null(revision_id)
200
if revision_id == revision.NULL_REVISION:
201
inv = inventory.Inventory(root_id=None)
202
inv.revision_id = revision_id
203
return revisiontree.RevisionTree(self, inv, revision_id)
205
return GitRevisionTree(self, self.get_mapping(), revision_id)
207
def get_inventory(self, revision_id):
208
assert revision_id != None
209
return self.revision_tree(revision_id).inventory
551
"""See Repository.revision_tree."""
552
if revision_id is None:
553
raise ValueError('invalid revision id %s' % revision_id)
554
return GitRevisionTree(self, revision_id)
556
def get_deltas_for_revisions(self, revisions, specific_fileids=None):
557
"""Produce a generator of revision deltas.
559
Note that the input is a sequence of REVISIONS, not revision_ids.
560
Trees will be held in memory until the generator exits.
561
Each delta is relative to the revision's lefthand predecessor.
563
:param specific_fileids: if not None, the result is filtered
564
so that only those file-ids, their parents and their
565
children are included.
567
# Get the revision-ids of interest
568
required_trees = set()
569
for revision in revisions:
570
required_trees.add(revision.revision_id)
571
required_trees.update(revision.parent_ids[:1])
573
trees = dict((t.get_revision_id(), t) for
574
t in self.revision_trees(required_trees))
576
# Calculate the deltas
577
for revision in revisions:
578
if not revision.parent_ids:
579
old_tree = self.revision_tree(_mod_revision.NULL_REVISION)
581
old_tree = trees[revision.parent_ids[0]]
582
new_tree = trees[revision.revision_id]
583
if specific_fileids is not None:
584
specific_files = [new_tree.id2path(
585
fid) for fid in specific_fileids]
587
specific_files = None
588
yield new_tree.changes_from(
589
old_tree, specific_files=specific_files)
211
591
def set_make_working_trees(self, trees):
214
def fetch_objects(self, determine_wants, graph_walker, progress=None):
215
return self._git.fetch_objects(determine_wants, graph_walker, progress)
218
class GitRevisionTree(revisiontree.RevisionTree):
220
def __init__(self, repository, mapping, revision_id):
221
self._repository = repository
222
self.revision_id = revision_id
223
assert isinstance(revision_id, str)
224
self.mapping = mapping
225
git_id = repository.lookup_git_revid(revision_id, self.mapping)
227
commit = repository._git.commit(git_id)
229
raise errors.NoSuchRevision(repository, revision_id)
230
self.tree = commit.tree
231
self._inventory = inventory.Inventory(revision_id=revision_id)
232
self._inventory.root.revision = revision_id
233
self._build_inventory(self.tree, self._inventory.root, "")
235
def get_revision_id(self):
236
return self.revision_id
238
def get_file_text(self, file_id):
239
entry = self._inventory[file_id]
240
if entry.kind == 'directory': return ""
241
return self._repository._git.get_blob(entry.text_id).data
243
def _build_inventory(self, tree_id, ie, path):
244
assert isinstance(path, str)
245
tree = self._repository._git.tree(tree_id)
246
for mode, name, hexsha in tree.entries():
247
basename = name.decode("utf-8")
251
child_path = urlutils.join(path, name)
252
file_id = self.mapping.generate_file_id(child_path)
253
entry_kind = (mode & 0700000) / 0100000
255
child_ie = inventory.InventoryDirectory(file_id, basename, ie.file_id)
256
elif entry_kind == 1:
257
file_kind = (mode & 070000) / 010000
258
b = self._repository._git.get_blob(hexsha)
260
child_ie = inventory.InventoryFile(file_id, basename, ie.file_id)
261
child_ie.text_sha1 = osutils.sha_string(b.data)
263
child_ie = inventory.InventoryLink(file_id, basename, ie.file_id)
264
child_ie.text_sha1 = osutils.sha_string("")
266
raise AssertionError(
267
"Unknown file kind, perms=%o." % (mode,))
268
child_ie.text_id = b.id
269
child_ie.text_size = len(b.data)
271
raise AssertionError(
272
"Unknown blob kind, perms=%r." % (mode,))
273
fs_mode = mode & 0777
274
child_ie.executable = bool(fs_mode & 0111)
275
child_ie.revision = self.revision_id
276
self._inventory.add(child_ie)
278
self._build_inventory(hexsha, child_ie, child_path)
281
class GitFormat(object):
283
supports_tree_reference = False
592
raise errors.UnsupportedOperation(self.set_make_working_trees, self)
594
def fetch_objects(self, determine_wants, graph_walker, resolve_ext_ref,
595
progress=None, limit=None):
596
return self._git.fetch_objects(determine_wants, graph_walker, progress,
600
class GitRepositoryFormat(repository.RepositoryFormat):
601
"""Git repository format."""
603
supports_versioned_directories = False
604
supports_tree_reference = True
284
605
rich_root_data = True
606
supports_leaving_lock = False
608
supports_funky_characters = True
609
supports_external_lookups = False
610
supports_full_versioned_files = False
611
supports_revision_signatures = False
612
supports_nesting_repositories = False
613
revision_graph_can_have_wrong_parents = False
614
supports_unreferenced_revisions = True
615
supports_setting_revision_ids = False
616
supports_storing_branch_nick = False
617
supports_overriding_transport = False
618
supports_custom_revision_properties = False
619
records_per_file_revision = False
622
def _matchingcontroldir(self):
623
from .dir import LocalGitControlDirFormat
624
return LocalGitControlDirFormat()
286
626
def get_format_description(self):
287
627
return "Git Repository"
289
def initialize(self, url, shared=False, _internal=False):
290
raise bzr_errors.UninitializableFormat(self)
629
def initialize(self, controldir, shared=False, _internal=False):
630
from .dir import GitDir
631
if not isinstance(controldir, GitDir):
632
raise errors.UninitializableFormat(self)
633
return controldir.open_repository()
292
635
def check_conversion_target(self, target_repo_format):
293
636
return target_repo_format.rich_root_data
638
def get_foreign_tests_repository_factory(self):
639
from .tests.test_repository import (
640
ForeignTestsRepositoryFactory,
642
return ForeignTestsRepositoryFactory()
644
def network_name(self):
648
def get_extra_interrepo_test_combinations():
649
from ..bzr.groupcompress_repo import RepositoryFormat2a
650
from . import interrepo
652
(interrepo.InterLocalGitNonGitRepository,
653
GitRepositoryFormat(), RepositoryFormat2a()),
654
(interrepo.InterLocalGitLocalGitRepository,
655
GitRepositoryFormat(), GitRepositoryFormat()),
656
(interrepo.InterToLocalGitRepository,
657
RepositoryFormat2a(), GitRepositoryFormat()),