Skip deleted files in presubmit.

Change-Id: I9998b3b606773ca1fdc5330c311820f977506b13
This commit is contained in:
Rob Mohr 2020-01-02 10:33:46 -08:00
parent 634360dbec
commit 1c38c7c1c9

View File

@ -99,8 +99,14 @@ def git_diff_names(commit: str = 'HEAD',
"""Returns absolute paths of files changed since the specified commit."""
root = git_repo_path(repo=repo)
return [
os.path.abspath(os.path.join(root, path)) for path in git_stdout(
'diff', '--name-only', commit, '--', *paths, repo=repo).split()
os.path.abspath(os.path.join(root, path))
for path in git_stdout('diff',
'--name-only',
'--diff-filter=d',
commit,
'--',
*paths,
repo=repo).split()
]