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,
# 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:
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