2018-08-23 22:01:53 -06:00
|
|
|
#!/bin/bash
|
2018-09-11 10:36:57 -06:00
|
|
|
LOCAL_DIR="$( dirname "${BASH_SOURCE}" )"
|
2018-08-23 22:01:53 -06:00
|
|
|
|
2018-09-11 10:36:57 -06:00
|
|
|
if git branch -vv | grep -q -P "^\*[^\[]+\[aosp/"; then
|
2018-08-23 22:01:53 -06:00
|
|
|
# Change appears to be in AOSP
|
|
|
|
exit 0
|
2021-05-24 13:43:35 -07:00
|
|
|
elif git log -n 1 --format='%B' $1 | grep -q -E "^Ignore-AOSP-First: .+" ; then
|
|
|
|
# Change is explicitly marked as ok to skip AOSP
|
|
|
|
exit 0
|
2018-08-23 22:01:53 -06:00
|
|
|
else
|
|
|
|
# Change appears to be non-AOSP; search for files
|
2018-09-11 10:36:57 -06:00
|
|
|
count=0
|
|
|
|
while read -r file ; do
|
|
|
|
if (( count == 0 )); then
|
|
|
|
echo
|
|
|
|
fi
|
2020-07-28 18:19:20 +01:00
|
|
|
echo -e "\033[0;31;47mThe source of truth for '$file' is in AOSP.\033[0m"
|
2018-09-11 10:36:57 -06:00
|
|
|
(( count++ ))
|
|
|
|
done < <(git show --name-only --pretty=format: $1 | grep -- "$2")
|
|
|
|
if (( count != 0 )); then
|
2018-08-23 22:01:53 -06:00
|
|
|
echo
|
2018-09-11 10:36:57 -06:00
|
|
|
echo "If your change contains no confidential details (such as security fixes), please"
|
|
|
|
echo "upload and merge this change at https://android-review.googlesource.com/."
|
2018-08-23 22:01:53 -06:00
|
|
|
echo
|
2018-12-03 10:56:56 -07:00
|
|
|
exit 1
|
2018-09-11 10:36:57 -06:00
|
|
|
fi
|
2018-08-23 22:01:53 -06:00
|
|
|
fi
|