PRESUBMIT should only check owners for the top level include directory
authorrmistry <rmistry@google.com>
Tue, 26 Aug 2014 21:00:54 +0000 (14:00 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 26 Aug 2014 21:00:55 +0000 (14:00 -0700)
BUG=skia:1846
R=borenet@google.com

Author: rmistry@google.com

Review URL: https://codereview.chromium.org/511503002

PRESUBMIT.py

index 726983027ce5b65fa935996bc4a87b149038326c..61fa2d6f92472543ff424ca08e9e01f52c5ebeeb 100644 (file)
@@ -189,11 +189,12 @@ def _CheckLGTMsForPublicAPI(input_api, output_api):
   """
   results = []
   requires_owner_check = False
-  for affected_svn_file in input_api.AffectedFiles():
-    affected_file_path = affected_svn_file.AbsoluteLocalPath()
+  for affected_file in input_api.AffectedFiles():
+    affected_file_path = affected_file.LocalPath()
     file_path, file_ext = os.path.splitext(affected_file_path)
-    # We only care about files that end in .h and are under the include dir.
-    if file_ext == '.h' and 'include' in file_path.split(os.path.sep):
+    # We only care about files that end in .h and are under the top-level
+    # include dir.
+    if file_ext == '.h' and 'include' == file_path.split(os.path.sep)[0]:
       requires_owner_check = True
 
   if not requires_owner_check: