##// END OF EJS Templates
git: fix handling of submodules that are not in the repo root (Issue #337)...
Thomas De Schampheleire -
r7528:ce5b7896 default
parent child Browse files
Show More
@@ -410,18 +410,19 b' class GitChangeset(BaseChangeset):'
410 filenodes = []
410 filenodes = []
411 als = self.repository.alias
411 als = self.repository.alias
412 for name, stat, id in tree.iteritems():
412 for name, stat, id in tree.iteritems():
413 if path != '':
414 obj_path = '/'.join((path, name))
415 else:
416 obj_path = name
413 if objects.S_ISGITLINK(stat):
417 if objects.S_ISGITLINK(stat):
414 cf = ConfigFile.from_file(BytesIO(self.repository._repo.get_object(tree['.gitmodules'][1]).data))
418 root_tree = self.repository._repo[self._tree_id]
415 url = cf.get(('submodule', name), 'url')
419 cf = ConfigFile.from_file(BytesIO(self.repository._repo.get_object(root_tree['.gitmodules'][1]).data))
416 dirnodes.append(SubModuleNode(name, url=url, changeset=id,
420 url = cf.get(('submodule', obj_path), 'url')
421 dirnodes.append(SubModuleNode(obj_path, url=url, changeset=id,
417 alias=als))
422 alias=als))
418 continue
423 continue
419
424
420 obj = self.repository._repo.get_object(id)
425 obj = self.repository._repo.get_object(id)
421 if path != '':
422 obj_path = '/'.join((path, name))
423 else:
424 obj_path = name
425 if obj_path not in self._stat_modes:
426 if obj_path not in self._stat_modes:
426 self._stat_modes[obj_path] = stat
427 self._stat_modes[obj_path] = stat
427 if isinstance(obj, objects.Tree):
428 if isinstance(obj, objects.Tree):
General Comments 0
You need to be logged in to leave comments. Login now