[scm] Remove gitlinks from list of affected files
Presubmit checks expect files to be actual files. Gitlink entries are
directories (if initialized), and that breaks various existing tests.
Since we don't run presubmits from git dependencies, it's safe to ignore
any updates to gitlinks and omit them from All Files.
R=jojwang
Change-Id: I670e5caef4067a0203578e9be50c4fabf23b3153
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4795116
Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Joanna Wang <jojwang@chromium.org>
diff --git a/scm.py b/scm.py
index dce9ef7..ee91025 100644
--- a/scm.py
+++ b/scm.py
@@ -132,7 +132,7 @@
raise gclient_utils.Error('Cannot determine upstream branch')
command = [
'-c', 'core.quotePath=false', 'diff', '--name-status', '--no-renames',
- '-r',
+ '--ignore-submodules=all', '-r',
'%s...%s' % (upstream_branch, end_commit)
]
status = GIT.Capture(command, cwd)
@@ -382,8 +382,10 @@
@staticmethod
def GetAllFiles(cwd):
"""Returns the list of all files under revision control."""
- command = ['-c', 'core.quotePath=false', 'ls-files', '--', '.']
- return GIT.Capture(command, cwd=cwd).splitlines(False)
+ command = ['-c', 'core.quotePath=false', 'ls-files', '-s', '--', '.']
+ files = GIT.Capture(command, cwd=cwd).splitlines(False)
+ # return only files
+ return [f.split(maxsplit=4)[-1] for f in files if f.startswith('100')]
@staticmethod
def GetPatchName(cwd):