We shouldn't just replace any occurence since we otherwise might also
substitute in the submodule.
Based on a patch by "ushen <yshxxsjt715@gmail.com>".
See https://github.com/agx/git-buildpackage/pull/82
# A submodules is shown as "commit" object in ls-tree:
if objtype == "commit":
nextpath = os.path.join(path, name)
- submodules.append((nextpath.replace(self.path, '').lstrip('/'),
- commit))
+ if nextpath.startswith(self.path):
+ nextpath = nextpath[len(self.path):].lstrip('/')
+ submodules.append((nextpath, commit))
if recursive:
submodules += self.get_submodules(commit, path=nextpath,
recursive=recursive)