summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIan Cordasco <graffatcolmingov@gmail.com>2016-10-25 10:31:57 +0000
committerIan Cordasco <graffatcolmingov@gmail.com>2016-10-25 10:31:57 +0000
commita90c94ab2281737c038bcdca873c6f07239eee59 (patch)
tree83c3b3e660316246eb6187ac9e7eb113b9e9f338 /src
parent7fc699e28bda8678d60d7a152a2341781f02220b (diff)
parent941896218d477c3ec117d21dc9da45d4265269b8 (diff)
downloadflake8-a90c94ab2281737c038bcdca873c6f07239eee59.tar.gz
Merge branch 'mr/120' into 'master'
Use the lazy parameter when finding changed files with git Closes !120 See merge request !126
Diffstat (limited to 'src')
-rw-r--r--src/flake8/main/git.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/flake8/main/git.py b/src/flake8/main/git.py
index 8603f67..d0c87d3 100644
--- a/src/flake8/main/git.py
+++ b/src/flake8/main/git.py
@@ -140,11 +140,14 @@ def make_temporary_directory_from(destination, directory):
def find_modified_files(lazy):
- diff_index = piped_process(
- ['git', 'diff-index', '--cached', '--name-only',
- '--diff-filter=ACMRTUXB', 'HEAD'],
- )
-
+ diff_index_cmd = [
+ 'git', 'diff-index', '--cached', '--name-only',
+ '--diff-filter=ACMRTUXB', 'HEAD'
+ ]
+ if lazy:
+ diff_index_cmd.remove('--cached')
+
+ diff_index = piped_process(diff_index_cmd)
(stdout, _) = diff_index.communicate()
stdout = to_text(stdout)
return stdout.splitlines()