Merge branch 'stable'
authorKarl Hasselström <kha@treskal.com>
Tue, 8 Jul 2008 18:24:43 +0000 (20:24 +0200)
committerKarl Hasselström <kha@treskal.com>
Tue, 8 Jul 2008 18:26:47 +0000 (20:26 +0200)
Conflicts:

stgit/commands/status.py

1  2 
stgit/commands/status.py
stgit/git.py
t/t0002-status.sh

@@@ -61,12 -61,11 +61,10 @@@ options = [make_option('-m', '--modifie
                         action = 'store_true'),
             make_option('--reset',
                         help = 'reset the current tree changes',
-                        action = 'store_true')
-            ] + make_diff_opts_option()
+                        action = 'store_true')]
  
  
- def status(files, modified, new, deleted, conflict, unknown, noexclude,
-            diff_flags):
 -def status(files = None, modified = False, new = False, deleted = False,
 -           conflict = False, unknown = False, noexclude = False):
++def status(files, modified, new, deleted, conflict, unknown, noexclude):
      """Show the tree status
      """
      cache_files = git.tree_status(files,
diff --cc stgit/git.py
@@@ -188,9 -190,11 +188,12 @@@ 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):
+     """Parse the output of git diff-index, diff-files, etc. Doesn't handle
+     rename/copy output, so don't feed it output generated with the -M
+     or -C flags."""
      t = None
      for line in output.split('\0'):
          if not line:
@@@ -169,10 -165,21 +169,21 @@@ EO
  test_expect_success 'Status of disappeared newborn' '
      stg refresh &&
      touch foo/bar &&
 -    stg add foo/bar &&
 +    git add foo/bar &&
      rm foo/bar &&
      stg status > output.txt &&
 -    diff -u expected.txt output.txt
 +    test_cmp expected.txt output.txt
  '
  
 -    diff -u expected.txt output.txt
+ cat > expected.txt <<EOF
+ A fay
+ D fie
+ EOF
+ test_expect_success 'Status after renaming a file' '
+     git rm foo/bar &&
+     git mv fie fay &&
+     stg status > output.txt &&
++    test_cmp expected.txt output.txt
+ '
  test_done