[CFE] Fix presubmit compile-and-lint when all changed files are filtered away

Change-Id: I1437755c7c2ef137a3fa37b3f0ec694ea8ab76dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405340
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
diff --git a/pkg/front_end/test/compile_and_lint_impl.dart b/pkg/front_end/test/compile_and_lint_impl.dart
index 46d4ec3..c5abe2f 100644
--- a/pkg/front_end/test/compile_and_lint_impl.dart
+++ b/pkg/front_end/test/compile_and_lint_impl.dart
@@ -82,6 +82,14 @@
     }
   }
 
+  // If we filtered everything away (e.g. only changed files in an ignored
+  // directory) we shouldn't try to run.
+  // It will fail and also doesn't make sense.
+  if (includedFilesFiltered.isEmpty) {
+    // 0 = no errors found.
+    return 0;
+  }
+
   Stopwatch stopwatch = new Stopwatch()..start();
 
   // TODO(jensj): The target has to be VM or we can't compile the sdk,