From 49b24e41da98c9230925e0b0cae3765a7ac14298 Mon Sep 17 00:00:00 2001 From: Josip Sokcevic Date: Fri, 18 Aug 2023 20:49:31 +0000 Subject: [PATCH] [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 Commit-Queue: Joanna Wang Reviewed-by: Joanna Wang --- scm.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scm.py b/scm.py index dce9ef789..ee9102510 100644 --- a/scm.py +++ b/scm.py @@ -132,7 +132,7 @@ class GIT(object): 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 @@ class GIT(object): @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):