| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -69,7 +69,11 @@ def get_conflicted_files(): | |||
| 69 | 69 | ||
| 70 | 70 | @memoize_by_cwd | |
| 71 | 71 | def get_staged_files(): | |
| 72 | - return cmd_output('git', 'diff', '--staged', '--name-only')[1].splitlines() | ||
| 72 | + return cmd_output( | ||
| 73 | + 'git', 'diff', '--staged', '--name-only', | ||
| 74 | + # Everything except for D | ||
| 75 | + '--diff-filter=ACMRTUXB' | ||
| 76 | + )[1].splitlines() | ||
| 73 | 77 | ||
| 74 | 78 | ||
| 75 | 79 | @memoize_by_cwd | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -33,6 +33,16 @@ def test_get_root_not_git_dir(tempdir_factory): | |||
| 33 | 33 | git.get_root() | |
| 34 | 34 | ||
| 35 | 35 | ||
| 36 | + def test_get_staged_files_deleted(tempdir_factory): | ||
| 37 | + path = git_dir(tempdir_factory) | ||
| 38 | + with cwd(path): | ||
| 39 | + open('test', 'a').close() | ||
| 40 | + cmd_output('git', 'add', 'test') | ||
| 41 | + cmd_output('git', 'commit', '-m', 'foo', '--allow-empty') | ||
| 42 | + cmd_output('git', 'rm', '--cached', 'test') | ||
| 43 | + assert git.get_staged_files() == [] | ||
| 44 | + | ||
| 45 | + | ||
| 36 | 46 | def test_is_not_in_merge_conflict(tempdir_factory): | |
| 37 | 47 | path = git_dir(tempdir_factory) | |
| 38 | 48 | with cwd(path): | |
| Back | FazBrowse Home | New Git URL |
0 commit comments