Skip deleted files in presubmit.
Change-Id: I9998b3b606773ca1fdc5330c311820f977506b13
diff --git a/pw_presubmit/py/pw_presubmit/tools.py b/pw_presubmit/py/pw_presubmit/tools.py
index 5fa3a4b..644cabb 100644
--- a/pw_presubmit/py/pw_presubmit/tools.py
+++ b/pw_presubmit/py/pw_presubmit/tools.py
@@ -99,8 +99,14 @@
"""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()
]