gbp: restrict splitting output of ls-tree to 3, since filenames might contain spaces
authorYaroslav Halchenko <yoh@debian.org>
Wed, 6 Apr 2011 17:21:51 +0000 (13:21 -0400)
committerGuido Günther <agx@sigxcpu.org>
Wed, 6 Apr 2011 17:58:38 +0000 (19:58 +0200)
Signed-off-by: Guido Günther <agx@sigxcpu.org>
gbp/git.py

index c7d04cb..e3de82e 100644 (file)
@@ -533,7 +533,8 @@ class GitRepository(object):
 
         out, ret =  self.__git_getoutput('ls-tree', args, cwd=path)
         for line in out:
-            mode, objtype, commit, name = line.split()
+            # Restrict to 3 splits, since filenames might contain spaces
+            mode, objtype, commit, name = line.split(None, 3)
             # A submodules is shown as "commit" object in ls-tree:
             if objtype == "commit":
                 nextpath = os.path.sep.join([path, name])