pre-upload: deleting files counts as modifying a project

When making a single commit that touches more than one project, it's
possible to delete files from one while adding to another. The
presubmits should notice this and avoid complaining about the choice of
subject prefix. Today, we ignore the deleted files and suggest using the
other prefix.

BUG=none
TEST=unittests; also ran on real CL that deletes from
     platform2/userfeedback and adds to platform2/debugd/

Change-Id: I0367ece39fe82ff05e798a53222c715a87fc9427
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/999913
Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/pre-upload.py b/pre-upload.py
index 74cdda4..ead2edb 100755
--- a/pre-upload.py
+++ b/pre-upload.py
@@ -1384,7 +1384,7 @@
 def _check_project_prefix(_project, commit):
   """Require the commit message have a project specific prefix as needed."""
 
-  files = _get_affected_files(commit, relative=True)
+  files = _get_affected_files(commit, include_deletes=True, relative=True)
   prefix = os.path.commonprefix(files)
   prefix = os.path.dirname(prefix)