Add presubmit error if third_party/.git exists.
Bug: webrtc:8366
Change-Id: I5fc91a18211ebbc2f6e61688bbafa7a7cc991916
Reviewed-on: https://webrtc-review.googlesource.com/78401
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23357}
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 7575948..922f3cd 100755
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -795,6 +795,7 @@
non_third_party_sources = lambda x: input_api.FilterSourceFile(x,
black_list=third_party_filter_list)
+ results.extend(CheckNoGitRepoInThirdParty(input_api, output_api))
results.extend(input_api.canned_checks.CheckLongLines(
input_api, output_api, maxlen=80, source_file_filter=eighty_char_sources))
results.extend(input_api.canned_checks.CheckLongLines(
@@ -834,6 +835,17 @@
return results
+def CheckNoGitRepoInThirdParty(input_api, output_api):
+ if os.path.isdir(input_api.os_path.join(
+ input_api.PresubmitLocalPath(), 'third_party', '.git')):
+ return [output_api.PresubmitError("Please remove third_party/.git "
+ "directory. This error means that "
+ "possibly you also have to apply other "
+ "instructions from the May 11th PSA from "
+ "titovartem@.")]
+ return []
+
+
def CheckThirdPartyChanges(input_api, output_api):
with _AddToPath(input_api.os_path.join(
input_api.PresubmitLocalPath(), 'tools_webrtc', 'presubmit_checks_lib')):