diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2012-07-12 11:26:55 +0300 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2012-11-23 19:26:36 +0100 |
commit | 36d13cb75dbcf321a3e882f4b3378f4833404294 (patch) | |
tree | 565490dd39d88b04c475dda19671be91713af33e /gbp/git | |
parent | 8bc79214f5e8dc4dfe8307a1caf8464464727493 (diff) |
GitRepository/get_submodules: use correct path
By default, run git in the repo path, not current cwd. Also, now returns
submodule paths without leading './'.
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'gbp/git')
-rw-r--r-- | gbp/git/repository.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gbp/git/repository.py b/gbp/git/repository.py index a855ac7..b2df4ea 100644 --- a/gbp/git/repository.py +++ b/gbp/git/repository.py @@ -1497,7 +1497,7 @@ class GitRepository(object): # the latter. submodules = [] if path is None: - path = "." + path = self.path args = [ treeish ] if recursive: @@ -1508,8 +1508,9 @@ class GitRepository(object): mode, objtype, commit, name = line[:-1].split(None, 3) # A submodules is shown as "commit" object in ls-tree: if objtype == "commit": - nextpath = os.path.sep.join([path, name]) - submodules.append( (nextpath, commit) ) + nextpath = os.path.join(path, name) + submodules.append( (nextpath.replace(self.path,'').lstrip('/'), + commit) ) if recursive: submodules += self.get_submodules(commit, path=nextpath, recursive=recursive) |