Index: presubmit_support.py |
diff --git a/presubmit_support.py b/presubmit_support.py |
index 79a61f84a7a0f409eeef28aaa1e795591bc0f2db..f583fb67e263c12a1b345d20b05a85bbab32d9c4 100755 |
--- a/presubmit_support.py |
+++ b/presubmit_support.py |
@@ -1183,22 +1183,22 @@ def load_files(options, args): |
"""Tries to determine the SCM.""" |
change_scm = scm.determine_scm(options.root) |
files = [] |
+ if args: |
+ files = ParseFiles(args, options.recursive) |
if change_scm == 'svn': |
change_class = SvnChange |
- status_fn = scm.SVN.CaptureStatus |
+ if not files: |
+ files = scm.SVN.CaptureStatus([], options.root) |
elif change_scm == 'git': |
change_class = GitChange |
- status_fn = scm.GIT.CaptureStatus |
+ # TODO(maruel): Get upstream. |
+ if not files: |
+ files = scm.GIT.CaptureStatus([], options.root, None) |
else: |
logging.info('Doesn\'t seem under source control. Got %d files' % len(args)) |
- if not args: |
+ if not files: |
return None, None |
change_class = Change |
- if args: |
- files = ParseFiles(args, options.recursive) |
- else: |
- # Grab modified files. |
- files = status_fn([options.root]) |
return change_class, files |