Merge branch 'stable' into stable-master-merge
authorKarl Hasselström <kha@treskal.com>
Tue, 3 Jun 2008 00:43:24 +0000 (02:43 +0200)
committerKarl Hasselström <kha@treskal.com>
Tue, 3 Jun 2008 00:43:24 +0000 (02:43 +0200)
1  2 
stgit/git.py

diff --cc stgit/git.py
@@@ -188,8 -190,20 +188,21 @@@ def ls_files(files, tree = 'HEAD', full
          # just hide the details of the 'git ls-files' command we use
          raise GitException, \
              'Some of the given paths are either missing or not known to GIT'
 +    return list(fileset)
  
+ def parse_git_ls(output):
+     t = None
+     for line in output.split('\0'):
+         if not line:
+             # There's a zero byte at the end of the output, which
+             # gives us an empty string as the last "line".
+             continue
+         if t == None:
+             mode_a, mode_b, sha1_a, sha1_b, t = line.split(' ')
+         else:
+             yield (t, line)
+             t = None
  def tree_status(files = None, tree_id = 'HEAD', unknown = False,
                    noexclude = True, verbose = False, diff_flags = []):
      """Get the status of all changed files, or of a selected set of